Chilkat Online Tools

VBScript / Plivo REST API / Retrieve a message

Back to Collection Items

Dim fso, outFile
Set fso = CreateObject("Scripting.FileSystemObject")
'Create a Unicode (utf-16) output text file.
Set outFile = fso.CreateTextFile("output.txt", True, True)

' This example assumes the Chilkat API to have been previously unlocked.
' See Global Unlock Sample for sample code.

' For versions of Chilkat < 10.0.0, use CreateObject("Chilkat_9_5_0.Http")
set http = CreateObject("Chilkat.Http")

http.BasicAuth = 1
http.Login = "{{auth_id}}"
http.Password = "password"

' For versions of Chilkat < 10.0.0, use CreateObject("Chilkat_9_5_0.StringBuilder")
set sbResponseBody = CreateObject("Chilkat.StringBuilder")
success = http.QuickGetSb("https://api.plivo.com/v1/Account/<auth_id>/Message/{message_uuid}/",sbResponseBody)
If (success = 0) Then
    outFile.WriteLine(http.LastErrorText)
    WScript.Quit
End If

outFile.WriteLine("Response status code = " & http.LastStatus)
outFile.WriteLine(sbResponseBody.GetAsString())

outFile.Close

Curl Command

curl -X GET
	-u '{{auth_id}}:password'
https://api.plivo.com/v1/Account/<auth_id>/Message/{message_uuid}/

Postman Collection Item JSON

{
  "name": "Retrieve a message",
  "request": {
    "method": "GET",
    "header": [
    ],
    "url": {
      "raw": "https://api.plivo.com/v1/Account/{{auth_id}}/Message/{message_uuid}/",
      "protocol": "https",
      "host": [
        "api",
        "plivo",
        "com"
      ],
      "path": [
        "v1",
        "Account",
        "{{auth_id}}",
        "Message",
        "{message_uuid}",
        ""
      ]
    },
    "description": "Retrieve details for a single message, more information can be found [here](https://www.plivo.com/docs/sms/api/message#retrieve-a-message)"
  },
  "response": [
    {
      "name": "Retrieve a message",
      "originalRequest": {
        "method": "GET",
        "header": [
        ],
        "url": {
          "raw": "https://api.plivo.com/v1/Account/{{auth_id}}/Message/{message_uuid}/",
          "protocol": "https",
          "host": [
            "api",
            "plivo",
            "com"
          ],
          "path": [
            "v1",
            "Account",
            "{{auth_id}}",
            "Message",
            "{message_uuid}",
            ""
          ]
        }
      },
      "code": 200,
      "_postman_previewlanguage": "json",
      "header": [
      ],
      "cookie": [
      ],
      "body": "{\n    \"api_id\": \"035eeada-6df1-11e6-b608-06a72a185e87\",\n    \"error_code\": \"200\",\n    \"from_number\": \"18552828641\",\n    \"message_direction\": \"outbound\",\n    \"message_state\": \"failed\",\n    \"message_time\": \"2016-08-17 21:22:36+05:30\",\n    \"message_type\": \"sms\",\n    \"message_uuid\": \"2a340179-e8a9-4b1d-ae2c-9f346e7b6d7d\",\n    \"resource_uri\": \"/v1/Account/{auth_id}/Message/2a340179-e8a9-4b1d-ae2c-9f346e7b6d7d/\",\n    \"to_number\": \"19352326448\",\n    \"total_amount\": \"0.00000\",\n    \"total_rate\": \"0.00350\",\n    \"units\": 1\n}"
    }
  ]
}