Interface ContactService


public interface ContactService
Contact related service

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 Details

    • list

      List Contacts

      List 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

      Contact get(String contactId)
      Get a Contact

      Returns 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

      Contact create(ContactCreateRequest contact)
      Create a Contact

      Most 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

      void delete(String contactId)
      Delete a contact as specified by the contact ID.
      Parameters:
      contactId - Contact's Id
      Since:
      1.3
    • update

      Contact update(String contactId, Contact contact)
      Updates a contact as specified by the contact ID.
      Parameters:
      contactId - Contact ID to be updated
      contact - Contact information to be updated
      Returns:
      Updated contact information
      Since:
      1.3
    • mergeContact

      Contact mergeContact(String destinationId, String sourceId)
      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

      String getChannelProfileByContactId(ContactGetChannelProfileByContactIdRequest parameters)
      Get user profile from a specific channel by contact ID.

      Only supported on MESSENGER, INSTAGRAM, VIBER and LINE 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 and LINE 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