In Twilio flex conversation, how to find worker sid

27 Views Asked by At

I have a Twilio flex inbound conversation. We want to find a worker sid to create a worker token after the worker accepts/joins into the conversation.

const worker = await client.flexApi.v1
  .interaction(interactionId as string)
  .channels(channelId as string)
  .participants.list({ limit: 20 })
  .then((participants) =
    participants.forEach((participant) => {
      return participant.type === 'agent';
    })
  );

I used the above code to get worker related to the interaction. But it is not returning worker_sid (WK id). But in the documentation, I can see we can find worker_sid using this and it is under the routingProperties in response. please advise how we can find it.

I referred https://www.twilio.com/docs/flex/developer/conversations/interactions-api/interaction-channel-participants.

sdk response:enter image description here

0

There are 0 best solutions below