[✅ Solution] Twilio api

Hi guys,

Does anyone successfully integrate twilio api in tape? coz i tried to setup it, in podio it works fine but same api call in tape it was not successful it returns error.

Thanks

Did you use the new API action? I tested in parallel (a different system, not Twilio) the same calls with Insomnia (Postman Alternative). While they worked there, the same call threw error 500 for me in Tape. Still trying to find out of its a bug or something on “layer 8”.

Hi @dirk_s,

yes i tried the new api action, both tested also using http.post() script, still getting error.
Hope @Tim can help us :slight_smile:

OK - my problem: I tried to run JavaScript in the request field. But thats a string only :wink:

1 Like

I guess this is a culmination of these other posts:

First, I don’t think it’s REQUIRED to use http.post in Execute script. If you want to use it inline so you can build a script immediately after that works with the data, then that makes sense, but I think either way, using the HTTP action would work fine too. The only difference at the moment is using http.post will also give you the status code and the headers (I created a feature request to get this same formatting from a standard HTTP action).

Please see attached screenshot. I believe this contains all of the components required to send an API call to Twilio. I’ve never used the Twilio API directly but it seems to want Content-Type to be multipart/form-data. This is the one bit I’m not sure of. Google searches using StackOverflow seem to reference a built in JS function called FormData that’s not available within Tape’s Execute Script action. So I’m not sure how to format the data variable to pass to the Twilio API.

Does it accept JSON instead? Because if so, you set Content-Type to application/json, and wrap the data object in JSON.stringify() and it will work fine. But I can’t test this theory because I don’t have the access required to do so.

1 Like

As stated also in the other thread, we created a guide that shows a basic integration of Twilio with Tape:

Hope it’s useful to you. Thanks for sharing your ideas and also thanks to @andrew.cranston for diving deeper into this! :heart_eyes:

Happy messaging :blue_heart:
Tim