Sinch Node.js SDK - v1.5.0
    Preparing search index...

    Class ContactApi

    Index

    Methods

    • 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 retrieve the username (detailed in the display_name field) with this Conversation API operation.

      Parameters

      Returns Promise<Contact>

    • 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

      Returns Promise<GetChannelProfileResponse>

    • 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

      Returns ApiListPromise<Contact>

    • 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&#39;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

      Returns Promise<Contact>