Jump to: navigation, search

Start Service

POST /genesys/1/cs/services/start

Description

Starts a service based on:

  • The service type passed in the body.
  • The contact information available (customer ID or contact key for later lookup).

If your application does not assign a customer ID, your service is anonymous. In that case, your application must assign a contact key. For further information, read the following pages:

Important
Your application is not responsible for the service ID creation. Context Services will automatically assign 64-bit integer IDs to the created services.

Attached Data

You can attach data to the service by adding key-value pairs to the JSON body of the POST action. Key-value pairs replace 8.1 extensions, do not need schema definition like in 8.1, and ensure backward compatibility with 8.1.

Operation

Start Service
ID CV.WS.SRV.1
Method POST
URL /genesys/1/cs/services/start
Field Name   Type   Mandatory Description
Body: Service Start Event. The body of this operation is mandatory and makes use of the Service Start Event.
customer_id string yes if no contact_key The unique ID of the customer associated with the given service.
Important
Services with no customer_id are anonymous. In this case, the event should include a contact_key.
contact_key string yes if no customer_id Key for later lookup of the service. This contact_key is mandatory if no customer ID is specified. For example, the application might store a PIN or ANI as the contact key when the service is first started. Later, if the customer is identified then the contact key is used to lookup the existing service record and associate it with the customer.
service_type long or string no The unique ID associated with the type of service, typically the DB ID of a value in the Service Type Business Attribute. Refer to Configuration Options for more details on Business Attribute mapping.
session_id string no The ID of the related session, for instance, the orchestration session, or any other business session.
interaction_id string no The ID of the related Genesys interaction. This ID can be used by other Genesys reporting products such as Stat Server, URS, Composer, and GVP.
application_type long or string no The unique ID associated with the type or class application issuing the service 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 unique ID (Genesys DB ID) for the application issuing the service event, such as a GVP VoiceXML application or an Orchestration SCXML application.
resource_type long or string no The unique ID associated with the type or class of resource which provides the service (such as GVP, Agent Desktop, or 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 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 service, for instance, email, voice, chat, etc. Refer to Configuration Options for more details on Business Attribute mapping.
est_duration integer no The estimated service duration in seconds.
timestamp date/time no The UTC time at which the event was raised, with a precision of milliseconds, using the ISO 8601 representation: [YYYY]-[MM]-[DD]T[HH]:[mm]:[ss].[SSS]Z. If the application does not specify this timestamp, the server does it when the event is processed.
auto_closed boolean no If true, creates a completed service; false, by default.
<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 201
HTTP message Created
Header Location: /genesys/1/cs/services/${service_id}

where:

  • ${service_id} is the service ID.
Body {"service_id": ${service_id}}

where:

  • ${service_id} is the service ID.

Example

Operation

POST http://localhost:8080/genesys/1/cs/services/start
{  
  "timestamp": "2009-05-12T12:05:12.145Z",
  "interaction_id": "123ABCAADFJ1259ACF",
  "application_type":400,
  "application_id":40,
  "est_duration":60,
  "contact_key":"42",
  "service_type":100,  
  "media_type": 1,
  "resource_id": 5005,
  "resource_type": 2,
  "disposition": 10, 
  "coupon": {
          "coupon_name": "DISCOUNTCODE15" 
  }, 
  "satisfaction": {
    "score": 85,
    "agentID": 2025
  },
  "relatedOffers": [
	  {
	   "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":"health check to be done before approval"
	  }
  ] 
}

Result

HTTP 201 Created
location: /genesys/1/cs/services/12349857
{"service_id": 12349857}
This page was last edited on January 17, 2018, at 10:56.
Comments or questions about this documentation? Contact us for support!