These docs are for v0.0.1. Click to read the latest docs for v1.0.63.

Session API Version Differences

New FieldRenamed FieldDeleted Field

Session APIs

Summary of changes:

  • The path has changed (base path + API path). "accountId" is mandatory in path of each API
  • "channelProviderId" which had to be passed while creating engagements has been shifted to "Create Session" API
  • Timestamps have changed from Epoch timestamp (int64) to 'yyyy-MM-dd'T'HH:mm:ss[.SSS]Z' format
  • New structure to pass customer identifiers like email address, phone numbers, etc.
  • Few new fields renamed, added or removed in request and response payload to make the data more consistent


API Version /v1 /v1beta
Base Path

https://HOST-REGION.cc.avayacloud.com/api/digital

https://HOST-REGION.cc.avayacloud.com/api/digital/channel

Create Session

POST /v1/sessions

POST /v1beta/accounts/{accountId}/sessions


Fields  Mandatory Comment Fields  Mandatory Comment
Path Parameter


accountId Y

Request Payload accountId Y Shifted to path parameter channelProviderId Y New Field
customerIdentifier Y
customerIdentifiers Y
displayName

displayName

sessionParameters

sessionParameters

firstName
use displayName providerCustomerId
New Field
lastName
use displayName correlationId
New Field
emailAddress
use customerIdentifiers


contactNumber
use customerIdentifiers



Response

Refer to Comparison of response for /v1 and /v1beta model


Sample Request

{
  "accountId": "UGMZHH",
  "customerIdentifier": "[email protected]",
  "displayName": "John Doe",
  "firstName": "John",
  "lastName": "Doe",
  "emailAddress": "[email protected]",
  "contactNumber": "+91 20 4101 8003",
  "sessionParameters": {
    "language": "english",
    "device": "mobile",
    "app": "chrome-mobile"
  }
}
{
  "channelProviderId": "ChatConnector01",
  "customerIdentifiers": {
    "emailAddresses": [
      "[email protected]"
    ],
    "phoneNumbers": [
      "+91 20 4101 8003"
    ]
  },
  "displayName": "John Doe",
  "sessionParameters": {
    "language": "english",
    "device": "mobile",
    "app": "chrome-mobile"
  },
  "providerCustomerId": "johndoe01",
  "correlationId": "zc38400d-c44f-4451-8316-e75c4efbt779"
}

Sample Response


Get Session

GET /v1/sessions/{sessionId}
GET /v1beta/accounts/{accountId}/sessions/{sessionId}

Fields  Mandatory Comment Fields  Mandatory Comment
Path Parameters


accountId Y
sessionId Y
sessionId Y

Response Refer to Comparison of response for /v1 and /v1beta model

Sample response




Update Session Parameters

POST /v1/sessions/{sessionId}:update

POST /v1beta/accounts/{accountId}/sessions/{sessionId}:updateSessionParameters


Fields  Mandatory Comment Fields  Mandatory Comment
Path Parameters


accountId Y
sessionId Y
sessionId Y

Request Payload sessionParameters Y
Map<String, String> Y

Response Refer to Comparison of response for /v1 and /v1beta model

Sample request
{
  "sessionParameters": {
    "country": "Ireland",
    "customerType": "Premium"
  }
}
{
  "country": "Ireland",
  "customerType": "Premium"
}
Sample response

Terminate Session

POST /v1/sessions/{sessionId}:terminate
DELETE /v1beta/accounts/{accountId}/sessions/{sessionId}

Fields  Mandatory Comment Fields  Mandatory Comment
Path Parameters


accountId Y
sessionId Y
sessionId Y

Query Parameters


reason  Y

Response 200 OK 204 No content

Append Identifiers

Not available in /v1

POST /v1beta/accounts/{accountId}/sessions/{sessionId}:appendIdentifiers

Path Parameters

accountId Y


sessionId Y

Request Payload








Identifiers: Y


Identifiers.universalIds



Identifiers.phoneNumbers



Identifiers.emailAddresses



Identifiers.accountIds



< * >


Response
Refer to /v1beta Session 

Sample Request

{
  "emailAddresses": [
    "[email protected]"
  ],
  "phoneNumbers": [
    "+31 20 5101 9005"
  ]
}
Sample Response


Comparison of response for /v1 and /v1beta model

Session 

API Version/v1

/v1beta

Model

Session

Session


Response model
sessionIdY
sessionIdY
displayNameY
displayName

customerIdentifier

customerIdentifiersY
sessionParameters

sessionParameters

sessionStatus

sessionStatus

createTimeMillis

createdAtY
updateTimeMillis

lastUpdatedAtY
accountIdY
accountIdY
uri

urlY
firstName

providerCustomerId

lastName

channelProviderId

emailAddress

correlationId

contactNumber

participantId

Sample response for /v1 and /v1beta 

Sample Session response

API Versiob /v1 /v1beta
Model Name

Session

Session


{
    "sessionId": "f7774987-c5f4-4473-a9e1-2c98eb7c6d57",
    "displayName": "John Doe",
    "customerIdentifier": "[email protected]",
    "firstName": "John",
    "lastName": "Doe",
    "emailAddress": "[email protected]",
    "contactNumber": "+91 20 4101 8003",
    "sessionParameters": {
        "language": "english",
        "device": "mobile",
        "app": "chrome-mobile"
    },
    "sessionStatus": "ACTIVE",
    "createTimeMillis": 1628861609,
    "updateTimeMillis": 1628861609,
    "accountId": "UGMZHH",
    "uri": "/api/digital/v1/sessions/100d5b8e-2a21-4ca5-a250-7e0d3a983f51"
}
{
    "sessionId": "f7774987-c5f4-4473-a9e1-2c98eb7c6d57",
    "accountId": "UGMZHH",
    "channelProviderId": "ChatConnector01",
    "displayName": "John Doe",
    "customerIdentifiers": {
        "phoneNumbers": [
            "+91 20 4101 8003"
        ],
        "emailAddresses": [
            "[email protected]"
        ]
    },
    "sessionParameters": {
        "language": "english",
        "device": "mobile",
        "app": "chrome-mobile"
    },
    "sessionStatus": "ACTIVE",
    "providerCustomerId": "55",
    "createdAt": "2021-08-13T13:31:56.550919Z",
    "lastUpdatedAt": "2021-08-13T13:31:56.550926Z",
    "url": "https://<FQDN>/api/digital/channel/v1beta/accounts/UGMZHH/sessions/f7774987-c5f4-4473-a9e1-2c98eb7c6d57",
    "correlationId": "zc38400d-c44f-4451-8316-e75c4efbt779",
    "participantId": "[email protected]"
}