Interface ContactsService


public interface ContactsService
Contacts Service
  • Method Details

    • list

      List Contacts (using default parameters)

      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).

      Returns:
      ContactsListResponse
      Throws:
      ApiException - if fails to make API call
    • 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:
      queryParameter - (optional)
      Returns:
      ContactsListResponse
      Throws:
      ApiException - if fails to make API call
    • contactGetChannelProfile

      GetChannelProfileResponse contactGetChannelProfile(GetChannelProfileRequest getChannelProfileRequest) throws ApiException
      Get Channel Profile

      Get user profile from a specific channel. 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:
      getChannelProfileRequest - (required)
      Returns:
      GetChannelProfileResponse
      Throws:
      ApiException - if fails to make API call
    • getChannelProfileByContactId

      Get user profile from a specific channel by contact ID.
      Parameters:
      parameters - The ID of the contact to be used to check profile information
      Throws:
      ApiException
      Since:
      1.3
      See Also:
    • getChannelProfileByChannelIdentity

      GetChannelProfileResponse getChannelProfileByChannelIdentity(ContactGetChannelProfileByChannelIdentityRequest parameters) throws ApiException
      Get user profile from a specific channel by channel identity.
      Parameters:
      parameters - The identity as specified by the channel to be used to check profile information
      Throws:
      ApiException
      Since:
      1.3
      See Also:
    • create

      Contact create(ContactCreateRequest contactCreateRequest) throws ApiException
      Create a Contact

      Most Conversation API contacts are [created automatically](https://developers.sinch.com/docs/conversation/contact-management/) when a message is sent to a new recipient. You can also create a new contact manually using this API call.

      Parameters:
      contactCreateRequest - The contact to create. (required)
      Returns:
      Contact
      Throws:
      ApiException - if fails to make API call
    • delete

      void delete(String contactId) throws ApiException
      Delete a Contact

      Delete a contact as specified by the contact ID.

      Parameters:
      contactId - The unique ID of the contact. (required)
      Throws:
      ApiException - if fails to make API call
    • get

      Contact get(String contactId) throws ApiException
      Get a Contact

      Returns a specific contact as specified by the contact ID. Note the following: - 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). - If you receive an Inbound Message callback for an MO message on the Instagram channel, the corresponding payload will not include the Instagram username. You may use the `contact_id` and `channel_identity` values included in the callback to retreive the username (detailed in the `display_name` field) with this Conversation API operation.

      Parameters:
      contactId - The unique ID of the contact. (required)
      Returns:
      Contact
      Throws:
      ApiException - if fails to make API call
    • listIdentityConflicts

      IdentityConflictsListResponse listIdentityConflicts() throws ApiException
      Lists Contact Identity Conflicts (using default parameters)

      Lists contact identity conflicts across supported SIM-based channels (SMS, MMS, RCS). Use this to identify contact records sharing the same identity (e.g., phone number), which must be resolved before enabling the Unified Contact ID feature.

      Returns:
      IdentityConflictsListResponse
      Throws:
      ApiException - if fails to make API call
    • listIdentityConflicts

      Lists Contact Identity Conflicts

      Lists contact identity conflicts across supported SIM-based channels (SMS, MMS, RCS). Use this to identify contact records sharing the same identity (e.g., phone number), which must be resolved before enabling the Unified Contact ID feature.

      Parameters:
      queryParameter - (optional)
      Returns:
      IdentityConflictsListResponse
      Throws:
      ApiException - if fails to make API call
    • mergeContact

      Contact mergeContact(String destinationId, MergeContactRequest mergeContactRequest) throws ApiException
      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. (required)
      mergeContactRequest - The contact to be removed. (required)
      Returns:
      Contact
      Throws:
      ApiException - if fails to make API call
    • update

      Contact update(String contactId, Contact contact) throws ApiException
      Update a Contact

      Updates a contact as specified by the contact ID.

      Parameters:
      contactId - The unique ID of the contact. (required)
      contact - The contact to be updated (required)
      Returns:
      Contact
      Throws:
      ApiException - if fails to make API call