Previous Topic

Book Contents

Book Index

Next Topic

Webservice

The webservice can be called by GET or POST methods.

Response 200 OK

Webservice call returns status code 200 when the call was successfully performed with JSON data about users matching called number.

GET

1

curl -i "http://10.150.66.20:8087/vmweb/services/api/ctiConnectedCall?calledNumber=123&callingNumber=00420737447077&pluginName=WebServiceA&accessToken=89e266fa-66e3-4c47-89b7-73d0a1f03ddf"

HTTP/1.1 200 OK

Server: Apache-Coyote/1.1

Date: Wed, 15 Jun 2016 08:14:49 GMT

Content-Type: application/json

Content-Length: 37

{"usersWithEnabledCTI":["SKM","SEM"],"usersWithDisabledCTI":["GOP"]}

POST

1

curl -i "http://10.150.66.20:8087/vmweb/services/api/ctiConnectedCall" -H "Content-Type: application/json;charset=UTF-8" --data-binary "{\"pluginName\":\"WebServiceA\",\"callingNumber\":\"00420737745698\",\"accessToken\":\"89e266fa-66e3-4c47-89b7-73d0a1f03ddf\",\"calledNumber\":\"123\"}" --compressed

HTTP/1.1 200 OK

Server: Apache-Coyote/1.1

Date: Wed, 15 Jun 2016 08:27:06 GMT

Content-Type: application/json

Content-Length: 62

{"usersWithEnabledCTI":["SKM"],"usersWithDisabledCTI":["SEM"]}

When no user matching the called number is found response JSON is empty:

{}.

Response 400 Bad Request

1

curl -i "http://10.150.66.20:8087/vmweb/services/api/ctiConnectedCall" -H "Content-Type: application/jsonharset=UTF-8" --data-binary "{\"pluginINVALID\":\"WebServiceA\",\"callingNumber\":\"00420737745698\",\"accessToken\":\"89e266fa-66e3-4c47-89b7-73d0a1f03ddf\",\"calledNumber\":\"123\"}" --compressed

HTTP/1.1 400 Bad Request

Server: Apache-Coyote/1.1

Date: Wed, 15 Jun 2016 08:33:41 GMT

Content-Type: application/json

Content-Length: 74

Connection: close

{"logStamp":"1465979621874","msg":"JSONObject[\"pluginName\"] not found."}

logStamp value can be used to find corresponding log entry in Valuemation.log on server for more details.

Response 401 Unauthorized

1

curl -i "http://10.150.66.20:8087/vmweb/services/api/ctiConnectedCall" -H "Content-Type: application/json;charset=UTF-8" --data-binary "{\"pluginName\":\"WebServiceA\",\"callingNumber\":\"00420737745698\",\"accessToken\":\"INVALID\",\"calledNumber\":\"123\"}" --compressed

HTTP/1.1 401 Unauthorized

Server: Apache-Coyote/1.1

Date: Wed, 15 Jun 2016 08:30:39 GMT

Content-Length: 0

Response 500 Internal Server Error

It is retuned e.g. unexpected error in workflow execution occurs.

See Also

Server Based CTI

Server Setup

User Setup

Example of Webservice Call

How to Test