titoalehandro
titoalehandro

Reputation: 35

How to get Flow SID in callback function

I'm trying to understand how to get Flow SID in a callback function.

  1. I created a small server with a flask (python).
  2. Also, I assigned ngrok URL of my server in setting the phone to "CALL STATUS CHANGES".
  3. And I start studio flow where I set one variable.
  4. I can debug every moment when I finished the call through the studio flow. In other words, the webhook works properly.

But I don't know how to catch Flow SID after the call was finished.

  1. I tried getting information from call (client.calls(request.get('CallSid')).fetch()), but nothing interesting: CAXXXXXXXXXXXXXXXXXX. I don't know how to use the call ID to get Flow ID.
  2. I put the static param in the URL of the hook (&flow_sid=4444). It seems to work, but I did not find the way how to put dynamic SID from the flow studio in params of the web-hook.

Could you help me get variable from studio flow to a callback function of the python server? Probably there is another simple way how to transfer data from studio flow to the callback function.

Upvotes: 0

Views: 586

Answers (2)

titoalehandro
titoalehandro

Reputation: 35

I added 1234566fsddf.ngrok.io/after_call?flow_sid={{flow.sid}} to the widget "Make HTTP request" in Flow Studio (thanks @Alan) and it works!

Upvotes: 1

Alan
Alan

Reputation: 10781

The Flow SID/Execution SID are exposed in the Trigger Widget.

{{flow.sid}}

{{flow.flow_sid}}

Upvotes: 0

Related Questions