Sub vonage (Phone As String, Message As String)
'curl -X "POST" "https://rest.nexmo.com/sms/json" \
' -d "from=15558889999" \
' -d "api_key=xxxxxx" \
' -d "api_secret=yyyyyyyyyy" \
' -d "to=15552279966" \
' -d "text=You are Registered in 3 contests with Bib 982"
Dim m As Map
m.Initialize
m.Put("from", myFromNumber)
m.Put("api_secret", txtSecret.text)
m.Put("to", Phone)
m.Put("text", Message)
m.Put("api_key", txtKey.text)
Dim json As JSONGenerator
json.initialize(m)
Dim stringtosend As String = json.ToString
Log(stringtosend)
Dim j As HttpJob
j.Initialize("", Me)
' j.Username=txtKey.Text
' j.Password=txtSecret.text
Dim link As String = "https://rest.nexmo.com/sms/json"
j.poststring(link,json.ToString )
j.GetRequest.SetContentType("application/x-www-form-urlencoded")
' j.PostMultipart(link,m,Null)
' j.PostBytes(link, stringtosend.GetBytes("utf-8"))
Wait For (j) JobDone(j As HttpJob)
If j.Success=True Then
Log(j.getstring)
Log("success")
j.Release
Else
'do something'
Log("ugh")
j.Release
End If
End Sub