Thanks for the code example, much appreciated. I keep getting a 400 HTTP
error however.

I am not using "HTTP_Request_Build" as I don't have it but I assume the "*"
is an option to omit or include some characters for formatting.

Here is what I am using from your code less proper username (assume it is
the Account SID), password (assume it is the Authorization token) and phone
numbers. Note I left out some parameters in the "HTTP Request" method as I
am using v13.6 on this version and there is no timeout parameter.

It may be that the "tRequest" var is not being formatted properly?

I'll be trying in v15 next to see if I get better results.


  // Twilio_Send
  //
  // $1 - TEXT - SendTo phone number
  // $2 - TEXT - Message to send

C_TEXT($1;$tSendToNumber)
C_TEXT($2;$tMessage)
$tSendToNumber:="5145551212"  //$1
$tMessage:="Test SMS"  //$2

C_TEXT($tURI;$tUserName;$tPassword;$tPlugin;$tInfo;$tFromNumber;$tRequest;$tResponse;tResponse)
C_LONGINT($lJson;$lHTTPStatus;$lTimeout;$lPort)

  // Stuff unique to your Twilio account
$tUserName:="Account SID"
$tPassword:="AUTH Token"  //"Your Twilio password"
$tFromNumber:="5552221212"  //"Your Twilio mobile account number"

$tURI:="https://api.twilio.com/2010-04-01/Accounts/"+$tUserName+"/Messages.json";
$tFromNumber:="+1"+$tFromNumber
$tSendToNumber:="+1"+$tSendToNumber

$tRequest:=""

$tRequest:="FROM="+$tFromNumber  //String_FixURL ($tFromNumber)
$tRequest:=$tRequest+"&To="+$tSendToNumber  //String_FixURL ($tSendToNumber)
$tRequest:=$tRequest+"&Body="+String_FixURL ($tMessage)


ARRAY TEXT($atHeaderNames;0)
ARRAY TEXT($atHeaderValues;0)
APPEND TO ARRAY($atHeaderNames;"content-type")
APPEND TO ARRAY($atHeaderValues;"application/x-www-form-urlencoded")
HTTP AUTHENTICATE($tUserName;$tPassword;HTTP Basic)
$lTimeout:=10
$lHTTPStatus:=HTTP Request(HTTP POST Method;$tURI;$tRequest;tResponse)




-----
Jim Labos - infobase
--
Sent from: http://4d.1045681.n5.nabble.com/4D-Tech-f1376241.html
**********************************************************************
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**********************************************************************

Reply via email to