Codless http request how to add basic Authorization header

Do you have an example of a working request? Perhaps with curl or with Postman?

want me to send it to you with credentials in private message?

No, you can remove the value of the authorization header and post it here.

curl -X POST https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Messages.json \
--data-urlencode "Body=Hi there!"
 \--data-urlencode "From=+15017122661"
 \--data-urlencode "To=+15558675310" 
\-u ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token

These parameters go into request body. Read the Twilio docs what they expect and add the logic to send that information:

yes mark i did and you can see the image i posted previously (the last one)

i add a create object block to the request body and added the 3 parameters as text.

that didnt work.

What you does not produce the same result. Make sure to follow the twillio docs to understand how they want the payload to be formatted.

how can i know what should i do to format it as required?
the only thing in twilio that explain the requirement is to url encode the parameter.
there is not much to do other that include a text block in codeless.

this is what i tried so far:

  • adding a text box with Body=“message”
  • adding create object with 2 text box. one have “Body” the other have “message”
  • adding create text with block and setting the first text to “Body” and the other to “message”
  • adding a text block with “Body%3DHi%20there%21”

Hi Mark, Mohammad,
I am having the same issue as I cannot send message. I get the following error:

I alos tried copying directly in the “body” section, but getting error: "A ‘To’ phonenumber is required’

Do you have a link for their API documentation for that operation?

Here is the link that I found:

So, there two approaches I am taking: 1) I tried using “Twilio” plugin and the service that you have by installing “Twilio Integration Plug-in”. This works with limited parameters. I can send the message without any issue, but I want to use Schedule Message where I provide two parameters: “ScheduleType” and “SendAt”. I am doing that but it is not recognizing those parameter and the messages is sent right away.
see screenshot below:

So, I moved to the second approach. Where I did all things in this thread but i cannot send message. It authenticates, but does not recognize any of the parameter values that I am sending.

I want to use the second method because I would like to use Twilio API to get response of all my texts, and stats using their API.
I also want to use “Voice” APIs that they have. Thank you.
My application id : 94496922-170D-4236-FF64-228CA5F5DE00

Hello @Sanjay_Christian,

  1. Please provide the name of the page this method can be find at.
  2. What do you try to achieve iterating through the first element of the contactsToSendSms? What does the j item looks like, what fields does it have?
  3. Also the way you try to get the contactID.firstName and contactID.phone looks incorrect.
    According to your database and assuming j is a UserContact object this part of code

should look like

Regards,
Olha

There are two approaches here and two ways:

First way: page is “CreateMessage”. This page works fine. It sends out texts immediately upon invoking of the “API Service “Twilio” Method “sendMessage”” . The problem is that I would like to “Schedule” this message and don’t want to send immediately. That is the reason why I added two parameters in “option” called “ScheduleType” and “SendAt”, but it does not schedule the message at specific time rather sends it right away igroring the parameters. How do I send parameters that Twilio API is expecting?

Second approach:
That is the reason why I took the second approach by directly calling Twilio API, but that API does not send the message at all. This page is under “Cloud Code”, “TwilioCustom”, method “scheduleMessage”. I would like to call this method to send message. The authentication works fine, but after that I get a message from Twilio stating that “A “To” phone number is required”. I am passing the “To” phone, but it is not being passed in the payload or server is receiving in a different format.

Let me know what I am doing wrong int he second approach. Thanks.

According to the Twilio documentation I see that the to, from and body parameters are lower case and you send them with capitalised letter. That may be the issue.

Also the internal ticket BKNDLSS-29843 is created to add the possibility for scheduling a message resource (right now we don’t have this feature in our service that’s why the first approach doesn’t work yet).

Regards,
Olha

I have changed that to lower case, but did not work. Thanks.

Hello @Sanjay_Christian!

I think this issue is due to the wrong body format, as in this case:

Could you please try changing the parameters and check again?

Regards,
Alexander

Hi Alexander,
I tried using simple parameters, but it did not work. I added the following in my input parameter:
to=%2B15161231234&from=%2B16311231234&body=Hithere

Hi @Sanjay_Christian

I didn’t check it, but it seems to me that this query should work
To=%2B15161231234&From=%2B16311231234&Body=Hithere

Could you please try it and let me know or did it work?

Regards,
Viktor

Hello @Sanjay_Christian

We have added the option of specifying the time to send the message. Documentation will be available soon, but in the meantime, you can reinstall the service and use the following parameters for the “sendMessage” method:

{
     "phoneNumber": "string",
     "message": "string",
     "options": {
      "senderPhoneNumber":"MG*******Messaging Service Sid*****",
      "sendAt": "in ISO-8601 format"
    }
}

Regards,
Inna

Hi Inna,
Yes! That worked! Thank you.