Contents
Composite Start of Service, State, Task
Added in: 8.5.110
POST /genesys/1/cs/services_composite/start
Description
Provides a single API call to update or create all Service, State, and Task objects in a single REST call. You can use this request to submit the JSON structures for three objects: Service, State, and Task events. If the Service object's customer_id, service_type, and contact_key do not match an active Service, the system will create one using this data, including State andTask data. Else, within the found service, it will search for the active State and Task respectively matching the state_type and the task_type specified in the request and it will create them if they are not found.
As a result, Context Services will reply with the IDs of the found and/or created Service, State, and Task resources, and a flag indicating whether they were created or not.
Operation
POST /genesys/1/cs/services_composite/start | |||
---|---|---|---|
Field Name | Type | Mandatory | Description |
Body Parameters | |||
services | JSON array | yes | JSON array of Composite Start Events. |
Composite Start Event
Field | Type | Mandatory | Description |
---|---|---|---|
service | JSON structure | yes | Service Start Event. |
state | JSON structure | yes | State Start Event. |
task | JSON structure | no | Task Start Event. |
associate_state_task | boolean | no | true to associate the Task with the given State; false by default.
If you set this parameter to true, it is equivalent to providing the State ID in a request to start a Task. |
Response
The Context Management Service API answers every request with HTTP codes. 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.
200 OK | |
---|---|
Header | Location: ${base_uri}/services/${service_id}/tasks/${task_id}
or ${base_uri}/services/${service_id}/states/${state_id} (if the task field was not provided in the request) where:
|
Body | {
service: { "service_id": ${service_id}, "created": "true/false" }
state: { "state_id": ${state_id}, "created": "true/false" }
task: { "task_id": ${task_id}, "created": "true/false" }
} |
Example
Operation
POST /genesys/1/cs/services_composite/start
{
"services" : [
{
"service": {
"interaction_id": "123ABCAADFJ1259ACF",
"application_type": "App_type_1",
"application_id": 40,
"est_duration": 60,
"customer_id":"${customer_id}",
"service_type": "MyService1",
"media_type": "voice",
"resource_id": 1183,
"resource_type": "ResType1",
"RelatedOffersService": [
{
"offer_name": "VIP credit card black ed.",
"type": 9,
"comments": "proposed to all client"
},
{
"offer_name": "3 times payment GOLD",
"type": 4,
"comments": "limited offer"
},
{
"offer_name": "life insurance",
"type": 3,
"comments": "healt check to be done before approval"
}
]
},
"state": {
"interaction_id": "123ABCAADFJ1259ACF",
"application_type": "App_type_1",
"application_id": 40,
"resource_type": "ResType1",
"resource_id": 1183,
"media_type": "voice",
"est_duration": 60,
"state_type": "MyState1",
"FeedbackState": {
"FeedbackType": "survey",
"rating": 7,
"notes": "warm welcome at frontdesk, thanks for the nice trip"
},
"SatisfactionState": [
{
"rating": 2,
"pertinence": 8,
"usefull": true,
"place": "Terranova mexico resort"
},
{
"rating": 8,
"pertinence": 4,
"usefull": false,
"place": "Fancy resort Paris"
}
]
},
"task": {
"interaction_id": "123ABCAADFJ1259ACF",
"application_type": "App_type_1",
"application_id": 40,
"resource_type": "ResType1",
"resource_id": 1183,
"media_type": "voice",
"est_duration": 60,
"task_type": "MyTask1",
"FeedbackTask": {
"FeedbackType": "survey",
"rating": 7,
"notes": "warm welcome at frontdesk, thanks for the nice trip"
},
"SatisfactionTask": [
{
"rating": 2,
"pertinence": 8,
"usefull": true,
"place": "Terranova mexico resort"
},
{
"rating": 8,
"pertinence": 4,
"usefull": false,
"place": "Fancy resort Paris"
}
]
},
"associate_state_task": "true"
}
]
}
Result
HTTP 200 OK
location: /genesys/1/cs/services/111222/tasks/555666
{
services: [
{
service: {
"service_id": 111222,
"created": "false"
},
state: {
"state_id": 333444,
"created": "true"
},
task: {
"task_id": 555666,
"created": "true"
}
}
]
}