Hello Appeon Support,
Good day!!!
I need your help, I currently working on a SMS blast project... I am using the HTTPClient and successfully retrieve the token, however, I cannot send data using POST method to send SMS to the server...
below is the code I am using, assumption is token is already send and store to a variable..
CODE----
String ls_Basic, ls_UserName, ls_Password, ls_Body,ls_json, ls_string
Integer li_Return
CoderObject lco_Code
HttpClient lhc_Client
lco_Code = Create CoderObject
lhc_Client = Create HttpClient
dw_2.AcceptText()
ls_json = dw_2.exportjson()
ls_Basic = lco_code.base64encode( Blob(ls_token , EncodingUTF8!))
lhc_Client.SetRequestHeader( "Authorization", "Basic " + ls_basic)
lhc_Client.SetRequestHeader("Content-Type", "application/json;charset=UTF-8")
li_Return = lhc_Client.SendRequest("POST", "https://messagingsuite.smart.com.ph/cgpapi/messages/sms",ls_json)
mle_1.text = lhc_Client.GetResponseStatusText()
If li_Return = 1 And lhc_Client.GetResponseStatusCode() = 200 Then
lhc_Client.GetResponseBody(ls_string)
Else
messagebox("error","error")
End If
END---
DOCUMENTATION FROM THE PROVIDER
Example Connect API Requests
SMS Request
POST https://messagingsuite.smart.com.ph/cgpapi/messages/sms
Authorization: Basic abcdef1234567890==
Content-Type: application/json;charset=UTF-8
Content-Length: 358
{
"messageType":"sms", "destination":"61299002200", "text":"Hello Connect API"
}
Appreciate your help...
thank you very much....