twilio conversations

poorna
poorna
edited August 11 in Conversations

I am new guy for using Rest APIs. I am using Twilio conversations. Is there a possibility to get the conversation sid (CH...) with the help of binding numbers?

Actual Usecase: I created few conversations and added participants. I dont have the conversation sid (CH..). I got exception while adding the same binding numbers to another conversation. I want to get the conversation sid (CH) to which those numbers are added. All I know is the binding numbers alone.

Please help.

Answers

  • shelbyz
    shelbyz ✭✭✭

    You may be able to take a look at one of two options:

    • Lookup via Conversations list of users
    • Lookup via ParticipantConversations

    I am including links to the auto-generated docs (for JS) as there are not many live examples. The base link for the helper library is https://twilio.com/docs/libraries/reference/twilio-node/

    Lookup via Conversation users might look like:

    const twilio = require('twilio')(account_sid, auth_token);
    const users = await twilio.conversations.users.list();
    for (let u of users) {
       // do something with binding against user properties
    }
    

    Lookup via ParticipantConversations might look look:

    const twilio = require('twilio')(account_sid, auth_token);
    const participantConversations = await twilio.conversations.participantConversations.list();
    for (let p of participantConversations) {
       // do something with binding against user properties
    }
    

    You may even be able to pass in the address the list call above to find conversations for those bindings.

If this is an emergency, please contact Twilio Support. This is not an official Support channel. https://support.twilio.com/
Have an urgent question?
Please contact Twilio Support. This is not an official Support channel.
Contact Support