Getting up on Twilio

Das Goravani goravanis at gmail.com
Mon Mar 6 16:38:46 UTC 2023


As an aside, you can use CURL to talk to Twilio. Here is an example of CURL that addresses the Twilio API.

How can I adapt this to work with Omnis?

curl -X POST https://api.twilio.com/2010-04-01/Accounts/{{ACCOUNT_SID}}/Messages.json \
--data-urlencode "From=+<TWILIO_PHONE_NUMBER>" \
--data-urlencode "Body=body" \
--data-urlencode "To=+<YOUR PHONE_NUMBER>" \
-u your_account_sid:your_auth_token

I just don’t know what to type into the HTTP Post command. I see the above, and wonder if it’s literal.. could I just type the above into the Post command?

There is only your account SID, a string, and auth_token, another string they give you. I have mine from them.

Then there is To, From and Body.. of the text message. 

Developer Support is trying to help me. They looked it up and they feel the HTTP Post command would work. They further think it could be done with Node.js.  I am not familiar with either. I see the Post command, just don’t know what to type into it so that it works. I’m wondering if the above gives it away. Perhaps someone more experienced could tell me how to adapt it to Omnis. 

I asked for the formatting of the HTTP Post statement, and they gave me a link to how to do it in Postman. It gives this CURL example as what it is going to replace.

I have heard you can do CURL with Omnis, is that right? 

Das

> On Mar 6, 2023, at 2:43 AM, Paul Mulroney <pmulroney at logicaldevelopments.com.au> wrote:
> 
> Hi Das,
> 
> You used to be able to do x-www-form-urlencoded in Omnis by creating a list with two columns: key and value.  If you were using the HTTPSend commands, this was one of the parameters you could pass in.  Not sure how that translates into the worker object.
> 
> I'll see if I can find an example.
> 
> Regards,
> Paul.
> 
> 
>> On 6 Mar 2023, at 5:01 am, Das Goravani <goravanis at gmail.com> wrote:
>> 
>> 
>> Everyone,
>> 
>> I am trying to get onto Twilio to send text messages.
>> 
>> I was going to use the HTTP Client Worker object.  
>> 
>> But it always binary encodes the contents field. Usually it’s in JSON too.
>> 
>> I told this to Twilio tech support and asked if it’s OK. 
>> 
>> They said NO. Here is their response:
>> 
>>> Short answer is no. The body and format of the requests must be exactly in the format that the documentation specify. Using binary bodies in JSON format will result in an exception.
>>> 
>>> Usually, most of our services accept x-www-form-urlencoded format.
>> 
>> 
>> What does that last line mean practically.. what do you do to be URLencoded like that?
>> 
>> Can I use the worker object?  If it always makes the contents field binary it seems I cannot use it with Twilio.
>> 
>> Some of you are on Twilio.. how do you do it?
>> 
>> Anticipating:
>> 
>> Das Goravani
>> 
>> 
>> _____________________________________________________________
>> Manage your list subscriptions at https://lists.omnis-dev.com
>> Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com 
> 
> 
> My friend asked me to help him round up his 37 sheep. I said “40”
> -- 
> Paul W. Mulroney                                            We Don't Do Simple Pty Ltd 
> pmulroney at logicaldevelopments.com.au       Trading as Logical Developments
> www.logicaldevelopments.com.au                   ACN 161 009 374 
> Ph: +61 8 9458 3889                                       86 Coolgardie Street
>                                                                         BENTLEY  WA  6102
> 
> 
> 
> _____________________________________________________________
> Manage your list subscriptions at https://lists.omnis-dev.com
> Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com 



More information about the omnisdev-en mailing list