Jump to: navigation, search

Complete State

POST /genesys/1/cs/services/${service_id}/states/${state_id}/end

Description

This operation terminates the state and updates its information with the body content.

Operation

Completes the state
ID CV.WS.SRV.6
Method POST
URL /genesys/1/cs/services/${service_id}/states/${state_id}/end
Field Name   Type   Mandatory Description
URI Parameters
${service_id} integer yes The unique 64-bit ID of the related service.
${state_id} integer yes The 32-bit ID of the state to complete.
Body: State End Event. This body can contain fields from the State End Event resource.
session_id string no The ID of the related session (for instance, the orchestration session or any other business session). Limited to 32 characters.
interaction_id string no The ID of the interaction at the service event's creation. Limited to 50 characters.
application_type long or string no The unique ID associated with the type or class of application which issued the state event. May be used to group related applications, potentially across resource types. Refer to Configuration Options for more details on Business Attribute mapping.
application_id integer no The Genesys DB ID for the application which issues the state event, such as a GVP VoiceXML application, Orchestration SCXML application, etc.
resource_type long or string no The unique ID associated with the type or class of resource providing the related service (such as GVP, Agent Desktop, Orchestration). Refer to Configuration Options for more details on Business Attribute mapping.
resource_id integer no The unique DB ID for the specific resource which provides the related service. For instance:
  • The Genesys DB ID of a specific GVP or orchestration platform
  • The DB ID of a given agent, according to the context.
media_type long or string no The media type applicable to the given state, such as email, voice, chat, etc. Refer to Configuration Options for more details on Business Attribute mapping.
disposition long or string no The unique ID for the business disposition assigned to the given state. For instance, this can be the DB ID of a Business Attribute used to enumerate a given organization’s business dispositions. Refer to Configuration Options for more details on Business Attribute mapping.
disposition_desc string no The text description which provides additional context on the business disposition.
timestamp date/time no The UTC time at which the service event was raised, with a precision of milliseconds, using the ISO 8601 representation: [YYYY]-[MM]-[DD]T[HH]:[mm]:[ss].[SSS]Z.
Important
If the application does not specify this timestamp, the server adds it when the service event is processed.
<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.

Response
HTTP code 200
HTTP message OK

Example

Operation
The following sample completes a state and updates the associated single-valued extension "Feedback". It assumes that you are using integers for values.

POST http://localhost:8080/genesys/1/cs/services/6739/states/5362/end
  {
   "interaction_id":"00001a57JGQ00BVS",
   "disposition": 10,
   "disposition_desc": "SUCCESS",
    "application_type":400,
    "application_id":40,
    "resource_type":200,
    "resource_id":20,
    "media_type":2,
    "Feedback": 
     {
      "FeedbackType":"survey",
      "rating":7,
      "notes":"warm welcome at frontdesk, thanks for the nice trip"
     }
   }

Result

 200 OK

Operation
The following sample completes a state and updates the associated single-valued extension "Feedback". It assumes that you configured business values, which allow string values.

POST /services/6739/states/5362/end
  {
    "interaction_id":"00001a57JGQ00BVS",
    "disposition": 10,
    "disposition_desc": "SUCCESS",
    "application_type":"customer_online_survey",
    "application_id":40,
    "resource_type":"html",
    "resource_id":20,
    "media_type":"webform",
    "Feedback": 
     {
      "FeedbackType":"survey",
      "rating":7,
      "notes":"warm welcome at frontdesk, thanks for the nice trip"
     }
   }

Result

 200 OK

Operation
The following sample completes a state and updates the associated single-valued extension "Feedback" and multi-valued extension "Satisfaction".

POST http://localhost:8080/genesys/1/cs/services/6739/states/5362/end
  {
   "interaction_id":"00001a57JGQ00BVS",
   "disposition": 10,
   "disposition_desc": "SUCCESS",
   "application_type":"customer_online_survey",
   "application_id":40,
   "resource_type":"html",
   "resource_id":20,
   "media_type":"webform",
   "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"
    }
    ]
  }

Result

 200 OK
This page was last edited on September 7, 2018, at 10:34.
Comments or questions about this documentation? Contact us for support!