Jump to: navigation, search

Query State by ID

ApiRef2.png GET /services/${service_id}/states/${state_id}
Available since: 8.0.100.00

Description

This operation allows you to retrieve a single state for a given service. By default, no task information in returned with the state representation. Optional URI parameters enable to include the state's nested tasks in the response.

Operation

ID CV.WS.SRV.15
Method GET
URL /services/${service_id}/states/${state_id}
Field name   Type   Mandatory Description
URI Parameters
${service_id} integer yes The service ID.
${state_id} integer yes The state ID.
active_tasks bool no
  • true to include information on the service's active tasks in the results.
  • false (default)
completed_tasks bool no
  • true to include information on the service's completed tasks in the results.
  • false (default)
extensions
Supported since 8.0.2
string no Names (separated by commas) of the state extensions to return with the matching state resources. You can specify as many extension names as needed, as long as you created them previously with the Create State Extension Schema. By default, no extension is returned.

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.

Response
HTTP code 200
HTTP message OK
Field Name   Type   Mandatory Description
Body: State<ref>This response includes the State representation with the state ID.</ref>
state_id integer yes The 32-bit integer ID of the state, assigned by the UCS when the state is started.
state_type long or string yes The unique ID associated with the state type. For instance, this ID can be the DB ID of a value in the Service Type Business Attribute.

Enumerated values could be one of the following:

  1. Customer identification
  2. Service identification
  3. Assign service agent
  4. Waiting for service agent
  5. Offering another service while waiting for agent
  6. Offering callback
  7. Callback pending
  8. Delivering service
  9. Waiting for customer input
  10. Offering another service while delivering service


Refer to Configuration Options for more details on Business Attribute mapping.

service_id integer yes if not nested in service resource The service's unique ID if the state is not part of a top-level service resource which includes a service ID.<ref name="toplevel">Only top-level representations include this field. For instance, if your application retrieves a service which includes nested states and tasks, only the top-level service resource contains this ID.</ref>
started State Start Event yes Related start event.
This event should not contain the "est_duration" field, if it already exists at the state level.
completed State End Event no The related end event if the state is completed.
This event should not repeat the "disposition" and "disposition_desc" fields if they already exist at the state level.
customer_id string no The customer's unique ID<ref name="toplevel"/>.
est_duration integer no The estimated time for completing the state, in seconds.
duration integer no The total duration in milliseconds.
Only relevant for completed states.
disposition long or string no ID of the Business Disposition ID.
Only relevant for completed states.
disposition_desc string no The reason for assigning the business disposition with the service element. Limited to 256 characters.
active_tasks Task[] no<ref name="option">This field is returned if the corresponding option is set to true in the URI parameters.</ref> The array of tasks that are started but not yet completed.
completed_tasks Task[] no<ref name="option"/> The array of Tasks that are completed.
<extension name>
Supported since 8.0.2
Extension (single-valued)
or Extension[] (multi-valued)
no State extension matching the parameter passed in the operation.

<references />

Example

Operation

 GET /services/2/states/1?active_tasks=true&completed_tasks=true&extensions=Feedback,Satisfaction

Result

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"}
  },
 "Satisfaction": [
  {
   "rating":2,
   "pertinence":8,
   "usefull":true,
   "place":"Terranova mexico resort"
  },
  {
   "rating":8,
   "pertinence":4,
   "usefull":false,
   "place":"Fancy resort Paris"
  }
  ],
  
  "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, // e.g. task for processing quote
      "disposition": 10, // e.g. 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 November 23, 2017, at 14:10.
Comments or questions about this documentation? Contact us for support!