This API Delivery page describes all possible ways to interact with CentraCX API. It's functionality is limited to completing surveys and checking on their status. For a survey to be available to be completed over this medium you must make sure to enable the API Channel when provisioning it's channels before deploying it.
- Listing All Surveys - Shows all deployed surveys
- Initiating a Session - Starts a session so a User can complete a survey
- Replying to Session - Once a session has been initiated, you can then begin replying to it to complete questions
- Checking Session Status - Checks the status of a specific session
Authentication
You MUST set the apikey and apisecret parameters for all calls to CentraCX API.
For example: apikey=&apisecret=
Failure to do so will result in a 401: Unauthorized response.
Security
CentraCX API is only available over HTTPS. Failure to use encryption will also result in a 401: Unauthorized response.
Base URL
<<<<<<< Updated upstream
All requests must be made to:
All requests must be made to: https://{your-URL}.centracx.com/
=======
>>>>>>> Stashed changes
JSON
All communication with the API must be made with JSON. No other format is accepted.
Listing All Surveys [GET]
Lists all deployed surveys
GET /surveys?apikey={apikey}&apisecret={apisecret}
Eg
https://{your-URL}.centracx.com/surveys?apikey={apikey}@apisecret={apisecret}
Example Reply
[
{
"id": 2,
"description": "Email Survey"
}
]
Initiating a Session [POST]
This starts a new session so that one can complete a survey.
A session id is replied along with the first question, question type and possible answers.
POST /surveys/{surveyId}?apikey={apikey}&apisecret={apisecret}
Parameter | Description |
surveyId | (Required) The id for the survey. |
Example Reply
{
"message": "New Session Started",
"survey": {
"title": "Email Survey"
},
"question": {
"text": "You recently switched your fund, could you please tell us what prompted this? Please select the one response that best reflects your personal circumstances.",
"type": "Choose one",
"title": "Question 1",
"answers": [
{
"text": "Discussion with family and friends",
"id": 48,
"value": "1"
},
{
"text": "Seeing or reading something in the media",
"id": 47,
"value": "2"
},
{
"text": "Higher returns",
"id": 81,
"value": "5"
},
{
"text": "Consultation with a financial adviser",
"id": 46,
"value": "3"
},
{
"text": "Other",
"id": 45,
"value": "4"
}
]
},
"sessionId": "eYzTVujx"
}
Replying to Session [POST]
Once a session has been started you may interact with it. There are some rules to follow as questions have different requirements. Below are the question types that are supported and how they relate to the metrics:
Question Type | Metrics | Description |
Enter Text | Collect Feedback | For 'Enter Text' question types it is required to reply with a 'feedback' field |
Choose One | Agent Quality, Net Promoter Score, Etc... | For 'Choose One' question types it is required to reply with an 'answerId' |
POST /surveys/{surveyId}?apikey={apikey}&apisecret={apisecret}&sessionId={sessionId}
Parameter | Description |
surveyId | (Required) The id of the survey |
sessionId | (Required) The session to interact with |
Example Reply
{
status: 200
data: {
question: abcdef
title: question 2
}
}
Checking Session Status [GET]
To check the status of a specific session. The possible values are:
- Invalid
- Partially Complete
- Complete
GET /surveys/{surveyId}?apikey={apikey}&apisecret={apisecret}&sessionId={sessionId}
Parameter | Description |
surveyId | Required The id of the survey. |
sessionId | Required The session to reply to |
Example Reply
{
status: {
id: 5,
description: 'Partially Complete'
}
}