-1

This is a Twilio API call i have been trying to run using LiveCode and it breaks down for me how to encapsulate it to run from LiveCode.

$ curl -XPOST https://api.twilio.com/2010-04-01/Accounts/AC5ef8732a3c49700934481addd5ce1659/Messages.json \

-d "Body=Jenny%20please%3F%21%20I%20love%20you%20<3" \
-d "To=%2B15558675309" \
-d "From=%2B14158141829" \
-d "MediaUrl=http://www.example.com/hearts.png" \
-u 'AC5ef8732a3c49700934481addd5ce1659:{AuthToken}'
Mark
  • 2,380
  • 11
  • 29
  • 49

2 Answers2

0

How about:

shell("curl -XPOST https://api...")
hliljegren
  • 426
  • 3
  • 9
  • @hlijegren thanks for your response,, but running the code above as a shell command will only look for such command on my local machine and report "No such file or directory". I am trying to make a call in the above format and return result which i can use in my stack. – steveuba Feb 03 '15 at 05:32
0

The data posts should be JSON formatted, and you will be using the "post" command. Here is the base:

post myJSON to URL "https://api.twilio.com/2010-04-01/Accounts/AC5ef8732a3c49700934481addd5ce1659/Messages.json"

and this is myJSON:

{
   "body": "Jenny please?! I love you <3",
   "from": "+14158141829",
   "to": "+15558675309",
   "MediaUrl": "http://www.example.com/hearts.png"
}
MadPink
  • 294
  • 1
  • 10