1. Overview

Customer interaction managent module’s API documentation

1.1. Version information

Version : 12.0.0

1.2. URI scheme

Schemes : HTTPS, HTTP

1.3. Tags

  • Contacts : APIs for contacts in the system

  • Schema : APIs to change Contact object attributes

  • Mapping : APIs to define search criteria for contact

  • Interactions : APIs to load or save interactions against a contact

1.4. Consumes

  • application/json

1.5. Produces

  • application/json

2. Resources

2.1. Contacts

APIs for contacts in the system

2.1.1. Get Contacts by Name

GET /contacts/getContactByName/{name}
Description

Get the searched contacts from database

Parameters
Type Name Description Schema

Path

name
required

Name of user that you want to find

string

Responses
HTTP Code Description Schema

200

List retrieved successfully

contacts

Produces
  • application/json

Example HTTP request
Request path
/contacts/getContactByName/string
Example HTTP response
Response 200
[ {
  "phone" : "03451234567",
  "first_name" : "John"
} ]

2.1.2. Get list of Contacts

GET /contacts/getContactList
Description

Get list of contacts from database

Responses
HTTP Code Description Schema

200

List retrieved successfully

contacts

Produces
  • application/json

Example HTTP request
Request path
/contacts/getContactList
Example HTTP response
Response 200
[ {
  "phone" : "03451234567",
  "first_name" : "John"
} ]

2.1.3. Get contact by search term

POST /contacts/getContactsBySearchTerms
Description

Get list of contacts from database

Parameters
Type Name Description Schema

Body

search
optional

Search terms for the contact the we want to search. Any number of properties can be included here in search criteria

searchOptions

Responses
HTTP Code Description Schema

200

List retrieved successfully

contacts

Produces
  • application/json

Example HTTP request
Request path
/contacts/getContactsBySearchTerms
Request body
{
  "phone" : "03451234567",
  "first_name" : "John"
}
Example HTTP response
Response 200
[ {
  "phone" : "03451234567",
  "first_name" : "John"
} ]

2.1.4. Load more contacts

GET /contacts/loadMore/{last_id}
Description

Get the searched contacts from database

Parameters
Type Name Description Schema

Path

last_id
required

Id of the last contact object received in the list

string

Responses
HTTP Code Description Schema

200

List retrieved successfully

contacts

Produces
  • application/json

Example HTTP request
Request path
/contacts/loadMore/string
Example HTTP response
Response 200
[ {
  "phone" : "03451234567",
  "first_name" : "John"
} ]

2.1.5. Create a new contact

POST /contacts/saveContact
Description

Create new contact in system

Parameters
Type Name Description Schema

Body

contact
optional

User that we want to create

contactObject

Responses
HTTP Code Description Schema

200

New user is created

contactObject

Produces
  • application/json

Example HTTP request
Request path
/contacts/saveContact
Request body
{
  "phone1" : "03451234567",
  "first_name" : "John",
  "last_name" : "Michael"
}
Example HTTP response
Response 200
{
  "phone1" : "03451234567",
  "first_name" : "John",
  "last_name" : "Michael"
}

2.1.6. Get user with given ID

GET /contacts/{contact_id}
Parameters
Type Name Description Schema

Path

contact_id
required

ID of user that we want to find

string

Responses
HTTP Code Description Schema

200

User is found

contactObject

Example HTTP request
Request path
/contacts/string
Example HTTP response
Response 200
{
  "phone1" : "03451234567",
  "first_name" : "John",
  "last_name" : "Michael"
}

2.1.7. Update user with given ID

PUT /contacts/{contact_id}
Parameters
Type Name Description Schema

Path

contact_id
required

ID of user that we want to find

string

Body

contact
optional

User with new values of properties

contactObject

Responses
HTTP Code Description Schema

200

User is updated

contactObject

Example HTTP request
Request path
/contacts/string
Request body
{
  "phone1" : "03451234567",
  "first_name" : "John",
  "last_name" : "Michael"
}
Example HTTP response
Response 200
{
  "phone1" : "03451234567",
  "first_name" : "John",
  "last_name" : "Michael"
}

2.1.8. Delete user with given ID

DELETE /contacts/{contact_id}
Parameters
Type Name Description Schema

Path

contact_id
required

ID of user that we want to find

string

Responses
HTTP Code Description Schema

200

User is deleted

No Content

Example HTTP request
Request path
/contacts/string

2.2. Schema

APIs to change Contact object attributes

2.2.1. List attributes of Contact Object

GET /schema/getSchema
Description

List all the attributes of contact object

Responses
HTTP Code Description Schema

200

Ok

schema

Produces
  • application/json

Example HTTP request
Request path
/schema/getSchema
Example HTTP response
Response 200
[ {
  "label" : "City",
  "key" : "city",
  "type" : "String"
} ]

2.2.2. Add a new Attribute to Contact Object

POST /schema/saveSchema
Description

Add new attribute to contact object

Parameters
Type Name Description Schema

Body

schema
optional

Attribute name that we want to create

schemaObject

Responses
HTTP Code Description Schema

200

New attribute has been added for contact object

schemaObject

Produces
  • application/json

Example HTTP request
Request path
/schema/saveSchema
Request body
{
  "label" : "City",
  "key" : "city",
  "type" : "String"
}
Example HTTP response
Response 200
{
  "label" : "City",
  "key" : "city",
  "type" : "String"
}

2.2.3. Update attribute with give ID

PUT /schema/{schema_id}
Parameters
Type Name Description Schema

Path

schema_id
required

ID of attribute that we want to delete

string

Body

schema
optional

User with new values of properties

schemaObject

Responses
HTTP Code Description Schema

200

User is updated

schemaObject

Example HTTP request
Request path
/schema/string
Request body
{
  "label" : "City",
  "key" : "city",
  "type" : "String"
}
Example HTTP response
Response 200
{
  "label" : "City",
  "key" : "city",
  "type" : "String"
}

2.2.4. Delete attribute with given ID

DELETE /schema/{schema_id}
Parameters
Type Name Description Schema

Path

schema_id
required

ID of attribute that we want to delete

string

Responses
HTTP Code Description Schema

200

User is deleted

No Content

Example HTTP request
Request path
/schema/string

2.3. Mapping

APIs to define search criteria for contact

2.3.1. Add condition to search criteria

POST /mapping
Description

Add condition to search criteria

Parameters
Type Name Description Schema

Body

mapping
optional

Attribute name that we want to create

searchCriteria

Responses
HTTP Code Description Schema

200

Condition’s been added in search criteria

searchConditions

Produces
  • application/json

Example HTTP request
Request path
/mapping
Request body
{
  "callVar" : "10",
  "callVariable" : "callVariable10",
  "key" : "city",
  "varNumber" : "10"
}
Example HTTP response
Response 200
[ {
  "callVar" : "10",
  "callVariable" : "callVariable10",
  "key" : "city",
  "varNumber" : "10"
} ]

2.3.2. Get defined search criteria

GET /mapping
Description

Get defined search criteria

Responses
HTTP Code Description Schema

200

Successfully

No Content

Produces
  • application/json

Example HTTP request
Request path
/mapping

2.3.3. Update condition with give ID

PUT /mapping/{id}
Parameters
Type Name Description Schema

Path

id
required

ID of the condition that we want to delete

string

Body

mapping
optional

condition with new values of properties

searchCriteria

Responses
HTTP Code Description Schema

200

condition is updated

searchCriteria

Example HTTP request
Request path
/mapping/string
Request body
{
  "callVar" : "10",
  "callVariable" : "callVariable10",
  "key" : "city",
  "varNumber" : "10"
}
Example HTTP response
Response 200
{
  "callVar" : "10",
  "callVariable" : "callVariable10",
  "key" : "city",
  "varNumber" : "10"
}

2.3.4. Delete condition with given ID

DELETE /mapping/{id}
Parameters
Type Name Description Schema

Path

id
required

ID of the condition that we want to delete

string

Responses
HTTP Code Description Schema

200

condition has been removed from search criteria

No Content

Example HTTP request
Request path
/mapping/string

2.4. Interactions

APIs to load or save interactions against a contact

2.4.1. Get List of interactions

GET /interactions/loadInteractions/{id}
Description

Get list of interactions for a specific contact from database

Parameters
Type Name Description Schema

Path

id
required

ID of the contact for which interactions need to be loaded

string

Responses
HTTP Code Description Schema

200

List retrieved successfully

interactions

Produces
  • application/json

Example HTTP request
Request path
/interactions/loadInteractions/string
Example HTTP response
Response 200
{
  "interactions" : [ {
    "type" : "Inbound",
    "agentId" : "10",
    "start_time" : "2018-01-01 00:00:00",
    "call_duration" : "10:35",
    "ivr_trail" : "A >B >C",
    "call_id" : "121",
    "call_disposition" : "Abandoned by agent",
    "team_name" : "default",
    "csq" : "queue1",
    "interaction_type" : "IVR",
    "wrap_up" : "Enquiry"
  } ],
  "call_Id" : "321",
  "phone_number" : "03451234567"
}

2.4.2. Add a new interaction to a contact

POST /interactions/updateOrSaveInteractionTree/{call_Id}
Description

Add new interaction to contact object

Parameters
Type Name Description Schema

Path

call_Id
required

ID of the contact for which interactions need to be loaded

string

Body

interactionObject
optional

condition with new values of properties

interactionData

Responses
HTTP Code Description Schema

200

Interaction object is created

interactionObject

Produces
  • application/json

Example HTTP request
Request path
/interactions/updateOrSaveInteractionTree/string
Request body
{
  "interaction" : {
    "type" : "Inbound",
    "agentId" : "10",
    "start_time" : "2018-01-01 00:00:00",
    "call_duration" : "10:35",
    "ivr_trail" : "A >B >C",
    "call_id" : "121",
    "call_disposition" : "Abandoned by agent",
    "team_name" : "default",
    "csq" : "queue1",
    "interaction_type" : "IVR",
    "wrap_up" : "Enquiry"
  },
  "call_Id" : "12",
  "ani" : "03451234567"
}
Example HTTP response
Response 200
{
  "type" : "Inbound",
  "agentId" : "10",
  "start_time" : "2018-01-01 00:00:00",
  "call_duration" : "10:35",
  "ivr_trail" : "A >B >C",
  "call_id" : "121",
  "call_disposition" : "Abandoned by agent",
  "team_name" : "default",
  "csq" : "queue1",
  "interaction_type" : "IVR",
  "wrap_up" : "Enquiry"
}

3. Definitions

3.1. contactObject

Name Description Schema

first_name
required

Example : "John"

string

last_name
optional

Example : "Michael"

string

phone1
required

Example : "03451234567"

string

3.2. contacts

Type : < contactObject > array

3.3. interactionData

Name Description Schema

ani
required

Example : "03451234567"

string

call_Id
required

Example : "12"

string

interaction
required

Example : "interactionObject"

interactionObject

3.4. interactionObject

Name Description Schema

agentId
optional

Example : "10"

string

call_disposition
optional

Example : "Abandoned by agent"

string

call_duration
optional

Example : "10:35"

string

call_id
optional

Example : "121"

string

csq
optional

Example : "queue1"

string

interaction_type
required

Example : "IVR"

string

ivr_trail
optional

in case of IVR type of interaction
Example : "A >B >C"

string

start_time
optional

Example : "2018-01-01 00:00:00"

string

team_name
optional

Example : "default"

string

type
required

Example : "Inbound"

string

wrap_up
optional

Example : "Enquiry"

string

3.5. interactions

Name Description Schema

call_Id
optional

Example : "321"

string

interactions
optional

Example : [ "interactionObject" ]

< interactionObject > array

phone_number
optional

Example : "03451234567"

string

3.6. schema

Type : < schemaObject > array

3.7. schemaObject

Name Description Schema

key
required

Example : "city"

string

label
required

Example : "City"

string

type
required

Example : "String"

string

3.8. searchConditions

Type : < searchCriteria > array

3.9. searchCriteria

Name Description Schema

callVar
optional

Example : "10"

string

callVariable
required

Example : "callVariable10"

string

key
required

Example : "city"

string

varNumber
optional

Example : "10"

string

3.10. searchOptions

Name Description Schema

first_name
optional

Example : "John"

string

phone
required

Example : "03451234567"

string