How to set username and password to make request

Hello everyone.

I need help to make request, i want to connect to twilio making request with my username (Account SID) and my password ( Auth Token) to send me a SMS and i don't know how set basic authentication to send request or Do i need other policies to do that?. I am using api proxy.

Thank for you help community.

0 4 927
4 REPLIES 4

How do you set basic authentication while making calls through Postman or any rest client?

If you are sending a base64encode string as an Authorization header,

  • then use a KVM to store the username and password values.
  • In the proxy use, KVM get to get the values and use Encode operation of Basic Authentication Policy. It can also set the Authorization header.

If you want to send them as FormParams, uri params, payload, queryparams, use Assign Message policy.

Also, tell us how are you connecting to Twilio? Are you using a Service callout policy?

Hello, I am new to this and I get a little complicated, first when I used Postman I simply made the request with cUrl (I only use twilio cUrl) so that in Postman I set the username password origin_number destination_number and make the request. It worked perfectly.

In this case i want make request only use apigee to twilio using cUrl and i don't understand how to do that, i have the follows parameters

  • Username
  • Password
  • origen_number
  • destination_number
  • Body

Can you help with some screenshot please?.

I am steel testing this, if I understand I'll let know it.

Thank for you help.

Can you mask sensitive data and share the Twilo CURL here.

Thank, when I make request to Twilio the response is:

Authentication Error - No credentials provided", "more_info": "https://www.twilio.com/docs/errors/20003", "status": 401}

So I need to set the Username and Password to access the twilio application and return the reply message to my phone number.

The curl is the following:

curl 'https://api.twilio.com/date/Accounts/<AccountSid>/Messages.json' -X POST

--data-urlencode 'To=+98765432109'

--data-urlencode 'From=+01234567890'

--data-urlencode 'MessagingServiceSid=<ServiceSid>

--data-urlencode 'Body=Texting with Twilio is easy :)'

-u <AccuntSid>:<AuthToken>

Thank you.