How to Use the Add Chat Collaborators API

In DoubleTick, a chat collaborator is an agent who is added to a conversation so they can view and participate in it alongside the primary assigned agent. While you can add collaborators manually from within the chat, the Add Chat Collaborators API lets you do this programmatically, making it possible to automate the process as part of a bot flow or backend workflow.

The full API reference is available here: https://docs.doubletick.io/reference/public-chat-collaborators-addarrow-up-right


What You Need Before You Start

To use this API, you need the following four pieces of information.

The first is the customer's phone number. This is the number of the person whose conversation you want to add a collaborator to. Include the country code.

The second is your WhatsApp API number. This is the DoubleTick-connected number on which that conversation exists. Include the country code.

The third is the agent's phone number. This is the phone number of the agent you want to add as a collaborator to that conversation. Include the country code.

The fourth is your API key, which goes into the header of the request. To find it, go to Settings inside DoubleTick, open the Developer Documentation section, and copy the key displayed there.


How to use Add Collaborator API

  • Enter the customer's phone number with country code in the designated field.

  • Enter your WhatsApp API number with country code in the designated field.

  • Enter the agent's phone number with country code in the designated field.

  • Go to Settings inside DoubleTick, open Developer Documentation, and copy your API key.

  • Paste the API key into the header field of the API call.

  • Click the Try It button to test the request.

  • A successful response will return a 200 Success code, confirming that the collaborator has been added to the conversation.

After the API is called, you can verify that it worked by opening the relevant conversation in DoubleTick. Go to the Chats section, search for the customer's number, and open the conversation. The agent you added should now appear as a collaborator on that chat.


Adding Add Collaborator API to a Bot or Workflow

If you want to add a collaborator automatically at a specific point in a bot conversation, you can embed this API call inside DoubleTick's Bot Studio.

  • On the API reference page, generate the cURL for your call and copy it.

  • Open the relevant bot in Bot Studio.

  • Add a new action component and select Call API from the list.

  • Connect it to the step at which the collaborator should be added.

  • Click the API dropdown and select Create New API.

  • Choose Import from cURL, paste the cURL, and name the API, for example Add Collaborator.

  • Save the API.

Once saved, the bot will automatically call this API whenever it reaches that step, adding the specified agent as a collaborator to the active conversation.


Summary

The Add Chat Collaborators API gives you the flexibility to assign collaborators to conversations without doing it manually, whether you are handling a one-off case from the documentation portal or automating the step inside a bot flow. If you run into any issues while setting this up, reach out to the DoubleTick support team for assistance.

Last updated