In order to add contacts to a list currently being used by a dialer campaign we are going to need:
- API documentation
- API Key for authentication
- List ID
- Contact Manager API methods
1. API Documentation
For references please keep this URL https://YourMotionIpAddress/apidoc/ as it keeps comprehensive documentation for XCALLY API subsystem.
2. API Key for Authentication
Calls to XCALLY API can be done through a username/password authentication, Token or API Key. The preferred method is to use an API Key as an account password may change due to the security suite and its token too.
To obtain a valid API Key just go to Staff > Users and then edit the desired administration account. For this particular case we will use admin
account. On the top bar left of the Save button there will be an orange icon labeled Api Key Manager. Click there.
Once the window is open simply click on Generate:
Once the button is clicked a message suggesting the API Key was updated will be presented on screen. To review the API Key click again the button.
The API Key can also be appreciated under the Security Suite section.
3. List ID
Because the Motion Bull Dialer works in conjunction with a List object this procedure assumes a contact will be added to a previously created list. To obtain a List ID simply go to Contacts Manager > Lists and obtain the List ID from the first column to the left:
For this example we will assume ID 4 for list Test_list.
4. Contact Manager API methods
The methods we are using in this example are taken from CM Lists method section at https://YourMotionIpAddress/apidoc/#api-Cm_Lists. The POST path to this method is:
/api/cm/lists/{id}/contacts
Please consider the following options to the body:
Field | Type | Description |
---|---|---|
firstName | String | |
lastName (optional) | String | |
street (optional) | String | |
postalCode (optional) | String | |
city (optional) | String | |
country (optional) | String | |
dateOfBirth (optional) | String | |
description (optional) | Text | |
phone (optional) | String | |
mobile (optional) | String | |
fax (optional) | String | |
email (optional) | String | |
url (optional) | String | |
facebook (optional) | String | |
fb_data (optional) | String | |
twitter (optional) | String | |
skype (optional) | String | |
teams (optional) | String | |
viber (optional) | String | |
line (optional) | String | |
wechat (optional) | String | |
telegram (optional) | String | |
UserId (optional) | Integer | |
priority (optional) | Integer | |
scheduledat (optional) | String |
4.1. Adding a contact to a list
To create a new contact in a list this is the syntax:
curl https://{domain}/api/cm/lists/{id}/contacts?apikey={apikey} -d '[{"firstName": "John Doe", "email": "john.doe@xcally.com", "...": "..."}]' \
-H 'Content-Type: application/json' -v -X POST
Each contact is created with a unique ID.
4.2. Remove a contact to a list
To remove a new contact we just use this method:
curl https://{domain}/api/cm/contacts/{id}?apikey={apikey} -v -X DELETE
Comments
0 comments
Please sign in to leave a comment.