Query Services
Modified in 8.5.111
|
Description
The operations on this page allow users to query for active and/or completed services, either for a specific customer or for anonymous services matching a contact key. The latter case primarily addresses service resumption use cases for services in which the customer is not yet identified. For example, consider the following:
- The customer calls in from phone number 408-832-7799.
- The application starts a service, noting contact key "408-832-7799" for further reference.
- The application is not able to identify the caller based on the phone number.
- IVR identifies that the customer is calling to set up a new wireless account.
- The customer is placed in an agent queue. After 10 minutes, the call is dropped.
- The customer calls back in from the same number. The application still cannot identify the customer based on that number.
- The application looks up whether there are any outstanding services with identification token "408-832-7799"--one is returned.
- The application asks the customer whether he or she is calling back in regards to the previous request or for a new wireless request. Upon confirmation, the customer is placed back in the agent queue.
Operations
Query Anonymous Services
ID | CV.WS.SRV.10 | ||
---|---|---|---|
Method | GET | ||
URI |
| ||
Field Name | Type | Mandatory | Description |
URI Parameters | |||
${contact_key} | string | yes | The "contact key" is supplied at the service creation if the service is started before the customer's identification. This key can be used to look up the service with this method, or for further association once the customer is identified (see Associate Service). |
started_from | date/time | no | Filters the services started on or after the given date/time given in
ISO 8601 representation: [YYYY]-[MM]-[DD]T[HH]:[mm]:[ss].[SSS]Z |
started_to | date/time | no | Filters the services started prior to the given date/time in
ISO 8601 representation: [YYYY]-[MM]-[DD]T[HH]:[mm]:[ss].[SSS]Z. |
completed_from | date/time | no | Filters the services that were completed on or after the given date/time in
ISO 8601 representation: [YYYY]-[MM]-[DD]T[HH]:[mm]:[ss].[SSS]Z. Only applicable when querying service history. |
completed_to | date/time | no | Filters the services completed prior to the given date/time. Only applicable when querying service history.
Date given in ISO 8601 representation: [YYYY]-[MM]-[DD]T[HH]:[mm]:[ss].[SSS]Z |
service_types | integer | no | Filters the services by the application-defined service type.
Refer to Configuration Options for more details on Business Attribute mapping. Your application can specify several types separated by a comma, as follows: service_types=1,3,45 |
active_states | bool | no |
|
active_tasks | bool | no |
|
completed_states | bool | no |
|
completed_tasks | bool | no |
|
max_services Added in: 8.5.111 |
integer | no | Maximum number of services to return. |
<extension key> | Any JSON type | no | Service attached data as key-value pairs. You can add as many key-value pairs as needed. |
Query Customer Services
ID | CV.WS.SRV.10 | ||
---|---|---|---|
Method | GET | ||
URIs |
| ||
Parameter | Type | Mandatory | Description |
URI Parameters | |||
${customer_id} | string | yes | The Customer ID, to get associated active or completed services. Note that a customer can be associated with a service either at the service creation or later in the process (see Associate Service). |
started_from | date/time | no | Filters the services started on or after the given date/time in
ISO 8601 representation: [YYYY]-[MM]-[DD]T[HH]:[mm]:[ss].[SSS]Z |
started_to | date/time | no | Filters the services started prior to the given date/time in
ISO 8601 representation: [YYYY]-[MM]-[DD]T[HH]:[mm]:[ss].[SSS]Z |
completed_from | date/time | no | Filters the services that were completed on or after the given date/time in
ISO 8601 representation: [YYYY]-[MM]-[DD]T[HH]:[mm]:[ss].[SSS]Z. Only applicable when querying service history. |
completed_to | date/time | no | Filters the services completed prior to the given date/time. Only applicable when querying service history. |
service_types | long or string | no | Filters the services by the application-defined service type.
Refer to Configuration Options for more details on Business Attribute mapping. |
active_states | bool | no |
|
active_tasks | bool | no |
|
completed_states | bool | no |
|
completed_tasks | bool | no |
|
max_services Added in: 8.5.111 |
integer | no | Maximum number of services to return. |
<extension key> | Any JSON type | no | Service 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 | Service[]. |
Example
Operation
GET /genesys/1/cs/customers/ABC1234/services/active?active_states=true
Response
[ // returned in an array
{ "customer_id": "ABC1234",
"service_id": 4692834,
"est_duration": 86400,
"started": {
"timestamp": "2009-05-07T12:05:20.157",
// additional Start Event fields
},
"active_states":
[// included given specification of "results" attribute
{ // array of one or more State objects
"state_id": 5005,
"state_type": 8, // service delivery
"started": {
"timestamp": "2009-05-07T12:08:53.298",
// additional Start Event fields
}
}
]
}]