HTML POST Help Please

[This was edited by @mark to resurrect the formatting and image]

Hello

I would like some help creating a HTML POST to the twilio api.

Sample code twilio have provided is. (they also provide alternative formats)

 <?php
// Get the PHP helper library from twilio.com/docs/php/install
require_once '/path/to/vendor/autoload.php'; // Loads the library
use Twilio\Rest\Client;

$sid = '<AccountSid>';
$token = '<AuthToken>';
$client = new Client($sid, $token);

$client->messages->create(
  '<customer_phone_number>',
  array(
    'from' => '<your_twilio_number>',
    'body' => 'text content',
  )
);

I have attempted to create a HTTP request using the POST method in this format

POST https://api.twilio.com/2010-04-01/Accounts/ [My Account Number]/Messages
Authorization: Basic [My Auth token]
Host: api.twilio.com
Content-Type: application/x-www-form-urlencoded
Content-Length: 50

To=555555555&From=555555556&Body=text content

The image shows how I’ve tried to do this. I don’t have experience in this area so everything I’ve done is via google, therefore I’m potentially way off.

I think this is probably a simple thing to do but as I’m inexperienced I’m struggling.

Thanks

What you want to do ?? Can you clarify it ??

I want to send a post method to the api with URL above, presumably using the webapi component.

The Post method results in a text message being sent by the api to a specified number and from a specified number with the body of the post being the message.

The thunkable webapi has fields for URL, Body and Headers which is fine. I’m putting the authorization in as a header and that is working. However I’m not sure where to put the From=+xxxxxxxx and To=+xxxxxxxxxx in the webapi component.

Thanks

Sorry !! but i havent’t used twilio yet. are you creating a otp verification system ??

It looks like I could do it in Thunkable Classic using the Web component which allows input of post text, however the Webapi in Thunkable X doesn’t have this functionality.

EDIT: Got it to work. set the BODY field to “From=%2BPhonenumber&To=%2BPhonenumber&Body=message”

Hey, i used the exact same method… i am getting error 401…can you please guide