Contact
Contacts
- Contacts Manage
GET global/contacts
GET global/contacts/{id}
POST global/contacts
PUT global/contacts/{id}
DELETE global/contacts/{id}
Model
Contact JSON Format
Contact is represented as simple flat JSON objects with the following keys:
Name | Type | Description |
---|---|---|
id |
guid | Id of the contact. |
name |
string | Contact Name can be edited by Agents. Default value is read from the first Identity. Only when a Contact sends a message in a specific channel that has a Name and an Avatar, like a Facebook Account, will the display Name and Avatar be used instead of the drawn from the contact profile. In all other situations, display will be drawn from the Contact Name and Avatar. |
firstName |
string | First Name of the contact. |
lastName |
string | Last Name of the contact. |
createTime |
datetime | When the contact was created. |
lastUpdatedTime |
datetime | The time of the last update time. |
mergeToContactId |
guid | Contact id which the contact merged to. |
Endpoint
Get the list of Contacts
GET global/contacts
Parameters:
Name | Type | In | Required | Description |
---|---|---|---|---|
contactIdentityValueSearch |
string | query | no | Search by contact identity's value. Call this interface 'Get the list of Contact identities' to get values. |
contactIdentityValue |
string | query | no | Value of the contact identity. |
contactKeywords |
string | query | no | Search scope includes: name, company, alias. |
contactIdentityType |
string | query | no | Type of the contact identity. |
contactIdentityName |
string | query | no | Name of the contact identity. |
include |
string | query | no | Allowed value is "contactIdentity". |
Response:
An array of Contact
Example
Sample Request:
curl https://api15.comm100.io/v4/global/contacts \
-X
'GET'
\
-H
'Authorization: Bearer {access_token}'
\
Response:
HTTP/1.1 200 OK
Get a single Contact
GET global/contacts/{id}
Parameters:
Name | Type | In | Required | Description |
---|---|---|---|---|
include |
string | query | no | Allowed value is "contactIdentity". |
include |
string | query | no | Allowed value is "contactIdentity". |
Response:
An array of Contact
Example
Sample Request:
curl https://api15.comm100.io/v4/global/contacts/{id} \
-X
'GET'
\
-H
'Authorization: Bearer {access_token}'
\
Response:
HTTP/1.1 200 OK
Create a new Contact
POST global/contacts
Parameters:
Name | Type | In | Required | Description |
---|---|---|---|---|
name |
string | body | yes | Contact Name can be edited by Agents. Default value is read from the first Identity. Only when a Contact sends a message in a specific channel that has a Name and an Avatar, like a Facebook Account, will the display Name and Avatar be used instead of the drawn from the contact profile. In all other situations, display will be drawn from the Contact Name and Avatar. |
firstName |
string | body | no | First Name of the contact. |
lastName |
string | body | no | Last Name of the contact. |
createTime |
datetime | body | no | When the contact was created. |
lastUpdatedTime |
datetime | body | no | The time of the last update time. |
mergeToContactId |
guid | body | no | Contact id which the contact merged to. |
contactIdentities |
contactIdentities[] | body | no | The list of contact identities. |
Response:
Example
Sample Request:
curl https://api15.comm100.io/v4/global/contacts \
-X
'POST'
\
-H
'Authorization: Bearer {access_token}'
\
-H
'Content-Type: application/json'
\
-D
'{"name":"Vincent","firstName":"Vincent","lastName":"Crabbe","createTime":"2021-04-16T10:05:38.7593288Z","lastUpdatedTime":"2021-04-16T10:05:38.7593288Z","mergeToContactId":"3aaf6c49-088b-46ff-bf86-cd96a612ecaf","contactIdentities":[{"contactIdentityType":"Twitter","value":"1361654692588728354","avatarUrl":"https://dash11.comm100.com/api/v4/chatbot/images/42dwdaww-92e6-4487-a2e8-92e68d6892e6","infoUrl":"https://dash17.comm100.io/api/twitterapp/platform/users?uid=1831584982944736245","screenName":"@Comm100Corp","originalContactPageUrl":"https://twitter.com/Vincent42"}]}'
Response:
HTTP/1.1 201 Created
Update the Contact
PUT global/contacts/{id}
Parameters:
Name | Type | In | Required | Description |
---|---|---|---|---|
name |
string | body | yes | Contact Name can be edited by Agents. Default value is read from the first Identity. Only when a Contact sends a message in a specific channel that has a Name and an Avatar, like a Facebook Account, will the display Name and Avatar be used instead of the drawn from the contact profile. In all other situations, display will be drawn from the Contact Name and Avatar. |
firstName |
string | body | no | First Name of the contact. |
lastName |
string | body | no | Last Name of the contact. |
createTime |
datetime | body | no | When the contact was created. |
lastUpdatedTime |
datetime | body | no | The time of the last update time. |
mergeToContactId |
guid | body | no | Contact id which the contact merged to. |
contactIdentities |
contactIdentities[] | body | no | The list of contact identities. |
Response:
Example
Sample Request:
curl https://api15.comm100.io/v4/global/contacts/d443150a-63d4-46dd-9a34-114359b7da0f \
-X
'PUT'
\
-H
'Authorization: Bearer {access_token}'
\
-H
'Content-Type: application/json'
\
-D
'{"name":"Vincent","firstName":"Vincent","lastName":"Crabbe","createTime":"2021-04-16T10:05:38.7593288Z","lastUpdatedTime":"2021-04-16T10:05:38.7593288Z","mergeToContactId":"3aaf6c49-088b-46ff-bf86-cd96a612ecaf","contactIdentities":[{"contactIdentityType":"Twitter","value":"1361654692588728354","avatarUrl":"https://dash11.comm100.com/api/v4/chatbot/images/42dwdaww-92e6-4487-a2e8-92e68d6892e6","infoUrl":"https://dash17.comm100.io/api/twitterapp/platform/users?uid=1831584982944736245","screenName":"@Comm100Corp","originalContactPageUrl":"https://twitter.com/Vincent42"}]}'
Response:
HTTP/1.1 200 OK
Remove the Contact
DELETE global/contacts/{id}
Parameters:
No Parameters
Response:
No Content
Example
Sample Request:
curl https://api15.comm100.io/v4/global/contacts/d443150a-63d4-46dd-9a34-114359b7da0f \
-X
'DELETE'
\
-H
'Authorization: Bearer {access_token}'
\
Response:
HTTP/1.1 204 No Content