B4X
B4X
Clickatell Get Message Status
See more Clickatell Examples
This API method will return the status of the given message ID.Chilkat B4X Downloads
Dim success As Boolean = False
' This example assumes the Chilkat API to have been previously unlocked.
' See Global Unlock Sample for sample code.
Dim http As ChilkatHttp
http.Initialize("http")
' Implements the following CURL command:
' curl -X GET --header 'Accept: application/json' \
' --header 'Authorization: API_KEY' \
' https://platform.clickatell.com/public-client/message/status?messageId=MESSAGE_ID
http.SetRequestHeader("Authorization", "API_KEY")
http.SetRequestHeader("Accept", "application/json")
Dim sbResponseBody As ChilkatStringBuilder
sbResponseBody.Initialize
success = http.QuickGetSb("https://platform.clickatell.com/public-client/message/status?messageId=MESSAGE_ID", sbResponseBody)
If success = False Then
Log(http.LastErrorText)
Return
End If
Dim jResp As ChilkatJsonObject
jResp.Initialize
jResp.LoadSb(sbResponseBody)
jResp.EmitCompact = False
Log("Response Body:")
Log(jResp.Emit)
Dim respStatusCode As Int = http.LastStatus
Log("Response Status Code = " & respStatusCode)
If respStatusCode >= 400 Then
Log("Response Header:")
Log(http.LastHeader)
Log("Failed.")
Return
End If
' Sample JSON response:
' (Sample code for parsing the JSON response is shown below)
' {
' "status example": "QUEUED"
' }
' Sample code for parsing the JSON response...
' Use the following online tool to generate parsing code from sample JSON:
' Generate Parsing Code from JSON
Dim status_example As String
status_example = jResp.StringOf("status example")