Jump to content
UBot Underground

Recommended Posts

How do i get this twilio code to work with HTTP POST

curl -X POST https://studio.twilio.com/v1/Flows/FWxxxxxxxxxxxxxxxxxxxxx/Executions \
-d "From=+12345678900" \
-d "To=+15556667777" \
-u ACyyyyyyyyyyyyyyyyyyyyy:zzzzzzzzzzzzzzzzzz
Link to post
Share on other sites
 

plugin command("HTTP post.dll", "http set headers", "u", "ACCOUNT-SID:Auth-Token")
set(#send message,$plugin function("HTTP post.dll", "$http post", "https://api.twilio.com/2010-04-01/Accounts/ACCOUNT-SID/Messages.json?From={$plugin function("HTTP post.dll", "$http text encoder", "url encode", "+19798885555")}&To={$plugin function("HTTP post.dll", "$http text encoder", "url encode", "+19895552222")}&Body={$plugin function("HTTP post.dll", "$http text encoder", "url encode", "this is the message to send")}", "", "", "", "", ""),"Global")

 

Think this will get it done for you

Link to post
Share on other sites

 

 

plugin command("HTTP post.dll", "http set headers", "u", "ACCOUNT-SID:Auth-Token")

set(#send message,$plugin function("HTTP post.dll", "$http post", "https://api.twilio.com/2010-04-01/Accounts/ACCOUNT-SID/Messages.json?From={$plugin function("HTTP post.dll", "$http text encoder", "url encode", "+19798885555")}&To={$plugin function("HTTP post.dll", "$http text encoder", "url encode", "+19895552222")}&Body={$plugin function("HTTP post.dll", "$http text encoder", "url encode", "this is the message to send")}", "", "", "", "", ""),"Global")

 

Think this will get it done for you

 

Thanks TJ.  I appreciate your help

 

I copied the code form your post but the twilio URL was cut off.  Funny because when I quote your post it shows correctly.  Anyways.  After I fixed i get a an error "The remote server returned an error: (401) Unauthorized."

 

I tried over and over to get it working but I cant get passed that Unauthorized error.  I dont quite understand the HTTP set headers command.  When does that get passed over.  I did use my credentials btw and when I copy the url  variable and paste it into my browser it prompts me for the username and password which i enter the AC and auth.  Doesnt send message but I can view my past messages that I sent

 

See my modified code below.  

clear all data
set(#ACCOUNT SID,"AC0000000000000000","Global")
set(#AUTH TOKEN,"AAAAAAAAAAAAAAAAAAA","Global")
set(#From,"+12125551212","Global")
set(#To,"+12125551313","Global")
set(#Body,"This is a Test","Global")
set(#url,"https://api.twilio.com/2010-04-01/Accounts/{#ACCOUNT SID}/Messages.json?From={$plugin function("HTTP post.dll", "$http text encoder", "url encode", #From)}&To={$plugin function("HTTP post.dll", "$http text encoder", "url encode", #To)}&Body={$plugin function("HTTP post.dll", "$http text encoder", "url encode", #Body)}","Global")
plugin command("HTTP post.dll", "http set headers", "u", "{#ACCOUNT SID}:{#AUTH TOKEN}")
set(#send message,$plugin function("HTTP post.dll", "$http post", #url, "", "", "", "", ""),"Global")

Below is a snapshot as well

 

Thanks in advance.

post-9583-0-25517500-1558487229_thumb.jpg

Edited by BigEfromDaBX
Link to post
Share on other sites

Try this

clear all data
set(#ACCOUNT SID,"AC0000000000000000","Global")
set(#AUTH TOKEN,"AAAAAAAAAAAAAAAAAAA","Global")
set(#From,"+12125551212","Global")
set(#To,"+12125551313","Global")
set(#Body,"This is a Test","Global")
set(#url,"https://api.twilio.com/2010-04-01/Accounts/{#ACCOUNT SID}/Messages.json","Global")
set(#parameters,"From={$plugin function("HTTP post.dll", "$http text encoder", "url encode", #From)}&To={$plugin function("HTTP post.dll", "$http text encoder", "url encode", #To)}&Body={$plugin function("HTTP post.dll", "$http text encoder", "url encode", #Body)}","Global")
plugin command("HTTP post.dll", "http set headers", "u", "{#ACCOUNT SID}:{#AUTH TOKEN}")
set(#send message,$plugin function("HTTP post.dll", "$http post", #url, #parameters, "", "", "", ""),"Global")
Link to post
Share on other sites

 

Try this

clear all data
set(#ACCOUNT SID,"AC0000000000000000","Global")
set(#AUTH TOKEN,"AAAAAAAAAAAAAAAAAAA","Global")
set(#From,"+12125551212","Global")
set(#To,"+12125551313","Global")
set(#Body,"This is a Test","Global")
set(#url,"https://api.twilio.com/2010-04-01/Accounts/{#ACCOUNT SID}/Messages.json","Global")
set(#parameters,"From={$plugin function("HTTP post.dll", "$http text encoder", "url encode", #From)}&To={$plugin function("HTTP post.dll", "$http text encoder", "url encode", #To)}&Body={$plugin function("HTTP post.dll", "$http text encoder", "url encode", #Body)}","Global")
plugin command("HTTP post.dll", "http set headers", "u", "{#ACCOUNT SID}:{#AUTH TOKEN}")
set(#send message,$plugin function("HTTP post.dll", "$http post", #url, #parameters, "", "", "", ""),"Global")

Thanks Nick.  But im still getting the same error:

 

#send message: The remote server returned an error: (401) Unauthorized.
 
I got it working with the python plugin that I downloaded from TJ.  I appreciate your help.
  • Like 1
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...