1

I'm trying to set a webhook callback that will be called by Twilio Studio at every stage of a posted message journey and send the activity status back to the webhook I set.

Studio Create Method (What Im currently using)

client.studio \
        .v2 \
        .flows(TwilioConstants.TWILIOFLOW_PROXY) \
        .executions \
        .create(
            to=f'whatsapp:{user_number}',
            from_=f'whatsapp:{TwilioConstants.BASENUMBER}',
            parameters={
                'name': data.customer.name,
                'user_email': data.customer.email}
        )

the create method will only accept 3 arguments

create(self, to, from_, parameters=values.unset):

However the messages create method accepts many arguments including the status_callback

client.messages.create

Can anyone tell me how I can get real-time individual WhatsApp message detailed updates sent to a webhook I set myself?

I have tried setting the webhook in: WhatsApp Sender -> Status callback URL but that appears to only send very granular data back and only when the user interacts with the message (to be fair I've not let the message timeout yet but possibly this would also be triggered if this happened or an error was encountered)

What I would like is more detailed information being posted back to my webhook such as found in Monitor -> Messaging -> Message Details

Any help with this one would be very much appreciated.

dazfaz
  • 11
  • 3
  • Can you explain your use-case a bit more in detail? You mentioned a Studio flow as well as the `client.messages.create` function, which are two different invocations. And do you need real time data or do you want want a programmatic way to access the logs? – IObert Nov 10 '22 at 09:38
  • Thanks for reaching out IObert. I need real time data to be posted to my webhook. The studio create method does not allow for a status_callback to be added as an argument. However the message create does. I'm using studio create at the moment as I have a number of flows created in studio. – dazfaz Nov 10 '22 at 09:54

1 Answers1

0

You are right; there is no status callback available in the Studio API. However, you can invoke your "own status callback" by using the Send HTTP Request widget within Studio.

You can either send all the needed parameters in that request or just the execution SID and then use the Execution API to fetch the details about the current step.

IObert
  • 2,118
  • 1
  • 10
  • 17