Python-powered Chat Apps with Twilio and SendGrid Transcripts
Chapter: Course conclusion and review
Lecture: Review: Calling an API in Studio
Login or
purchase this course
to watch this video and the rest of the course contents.
0:00
That Flask API endpoint we created. That was our end of the story. But over in Twilio studio, we need to connect our flow over there back to
0:09
that API endpoint. In order to do that, we did a couple of interesting things. We added the make http request widget to our flow.
0:17
And we told it we're going to do a post request over to our URL of type application/json. And then down here at the bottom,
0:25
we put all the information we want. We've gathered up and we want to convey across to that end points with our customer
0:32
with the number, and name and email, the cake with the topping and so on and even the price that we got from
0:38
that PricingAPI. The other thing of note here is that we're using in ngrok. Remember, we did this all the way back to our Dev machine
0:47
and we were able to set a breakpoint in PyCharm or whatever editor you're using
0:52
set a breakpoint there and look at the code and inspected at this running as part of studio calling over to our api endpoint.
1:00
That was super cool. How did that happen ngrock. In my example, I had to paid account and I was able to use cloudcity.ngrok.io.
1:08
But in practice, you probably have some random GUI looking thing there, so make sure that's always up to date as you're working with your api and maybe
1:17
restarting in ngrock, and it changes.