Interface ContactService
A contact is a collection that groups together underlying connected channel recipient identities.
It's tied to a specific project and is therefore considered public to all apps sharing the same project.
Most contact creation and maintenance is handled by the Conversation API's automatic see contact management processes.
However, you can also use API calls to manually manage your contacts.
- Since:
- 1.3
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptioncreate
(ContactCreateRequest contact) Create a Contactvoid
Delete a contact as specified by the contact ID.Get a ContactGet user profile from a specific channel by channel identity.Get user profile from a specific channel by contact ID.list
(ContactListRequest parameters) List ContactsmergeContact
(String destinationId, String sourceId) Merge two Contacts.Updates a contact as specified by the contact ID.
-
Method Details
-
list
List ContactsList all contacts in the project. Note that, if a WhatsApp contact is returned, the display_name field of that contact may be populated with the WhatsApp display name (if the name is already stored on the server and the display_name field has not been overwritten by the user).
- Parameters:
parameters
- Filtering parameters- Returns:
- List of contacts according to search criteria
- Since:
- 1.3
-
get
Get a ContactReturns a specific contact as specified by the contact ID. Note that, if a WhatsApp contact is returned, the display_name field of that contact may be populated with the WhatsApp display name (if the name is already stored on the server and the display_name field has not been overwritten by the user).
- Parameters:
contactId
- Contact's Id- Returns:
- Contact information
- Since:
- 1.3
-
create
Create a ContactMost Conversation API contacts are created automatically when a message is sent to a new recipient. You can also create a new contact manually using this API call.
- Parameters:
contact
- Contact information to be used for creation- Returns:
- Contact information
- Since:
- 1.3
-
delete
Delete a contact as specified by the contact ID.- Parameters:
contactId
- Contact's Id- Since:
- 1.3
-
update
Updates a contact as specified by the contact ID.- Parameters:
contactId
- Contact ID to be updatedcontact
- Contact information to be updated- Returns:
- Updated contact information
- Since:
- 1.3
-
mergeContact
Merge two Contacts.The remaining contact will contain all conversations that the removed contact did.
If both contacts had conversations within the same App, messages from the removed contact will be merged into corresponding active conversations in the destination contact.
Channel identities will be moved from the source contact to the destination contact only for channels that weren't present there before.
Moved channel identities will be placed at the bottom of the channel priority list. Optional fields from the source contact will be copied only if corresponding fields in the destination contact are empty
The contact being removed cannot be referenced after this call.
- Parameters:
destinationId
- The unique ID of the contact that should be kept when merging two contacts.sourceId
- The ID of the contact that should be removed- Returns:
- The merged contact details
- Since:
- 1.3
-
getChannelProfileByContactId
Get user profile from a specific channel by contact ID.Only supported on
MESSENGER
,INSTAGRAM
,VIBER
andLINE
channels.Note that, in order to retrieve a WhatsApp display name, you can use the Get a Contact or List Contacts operations, which will populate the display_name field of each returned contact with the WhatsApp display name (if the name is already stored on the server and the display_name field has not been overwritten by the user).
- Parameters:
parameters
- The ID of the contact to be used to check profile information- Returns:
- The profile name
- Since:
- 1.3
-
getChannelProfileByChannelIdentity
String getChannelProfileByChannelIdentity(ContactGetChannelProfileByChannelIdentityRequest parameters) Get user profile from a specific channel by channel identity.Only supported on
MESSENGER
,INSTAGRAM
,VIBER
andLINE
channels.Note that, in order to retrieve a WhatsApp display name, you can use the Get a Contact or List Contacts operations, which will populate the display_name field of each returned contact with the WhatsApp display name (if the name is already stored on the server and the display_name field has not been overwritten by the user).
- Parameters:
parameters
- The identity as specified by the channel to be used to check profile information- Returns:
- The profile name
- Since:
- 1.3
-