Query States
GET /genesys/1/cs/genesys/1/cs/services/${service_id}/states |
Description
This operation queries the states for a given service. By default, all the states are returned, but your application can filter the results to retrieve only active or completed states, based on the specified URI. Additional URI parameters enable to include task information in the response.
Operation
ID | CV.WS.SRV.12 | ||
---|---|---|---|
Method | GET | ||
URL |
| ||
Field Name | Type | Mandatory | Description |
URI Parameters | |||
${service_id} | string | yes | The service ID generated from the Start Service operation. |
state_types | integer | no | Filters specific service state types. The possible enumerated values are available in the filter field of the State resources. You can specify several state_type values separated by commas. |
active_tasks | bool | no |
|
completed_tasks | bool | no |
|
<extension> | Any JSON type | no | State attached data as key-value pairs. You can add as many key-value pairs as needed. |
Response
The Context Management Service API answers with HTTP codes for every request. The following table shows the correct response for a successful request. See HTTP Response Codes and Errors for further details on the possible codes that this operation can return.
HTTP code | 200 |
---|---|
HTTP message | OK |
Body | State[] |
Example
Operation
GET /genesys/1/cs/services/ABC1235XZY/states/active&active_tasks=true&completed_tasks=true&extensions=Feedback
Result The following output shows a possible response for the previous request:
200 OK [ // array of one or more state object { "service_id" : 1, "state_id" : 0, "state_type" : 100, "est_duration" : 60, "started" : { "timestamp" : "2010-05-18T15:23:34.447Z", "application_type" : 400, "resource_id" : 20, "media_type" : 2, "resource_type" : 200, "application_id" : 40, "interaction_id" : "51" "Feedback": { "FeedbackType":"survey", "rating":7, "notes":"warm welcome at frontdesk, thanks for the nice trip"} }, "active_tasks": [ // included given specification of "results" attribute { // array of one or more Task objects "task_id": 25080, "task_type": 5, // application-defined task type "est_duration": 300, "started": { "timestamp": "2009-05-07T12:08:53.298", } } ] "completed_tasks": [ { "task_id": 24027, "task_type": 2, // such as task for processing quote "disposition": 10, // such as quote completed "disposition_desc": "<text describing quote result>", "started": { "timestamp": "2009-05-07T12:02:23.715", "interaction_id": "123ABC908ABFFD8080" }, "completed": { "timestamp": "2009-05-07T12:06:23.715", "interaction_id": "157C9A208AFD523D01" } } ] }, { "service_id" : 1, "state_id" : 1, "state_type" : 100, "est_duration" : 60, "started" : { "timestamp" : "2010-05-18T15:23:41.977Z", "application_type" : 400, "resource_id" : 20, "media_type" : 2, "resource_type" : 200, "application_id" : 40, "interaction_id" : "51" } } ]
This page was last edited on April 27, 2017, at 10:18.
Comments or questions about this documentation? Contact us for support!