Chilkat Online Tools

PowerBuilder / Plivo REST API / Retrieve a recording

Back to Collection Items

integer li_rc
oleobject loo_Http
integer li_Success
oleobject loo_SbResponseBody

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

loo_Http = create oleobject
// Use "Chilkat_9_5_0.Http" for versions of Chilkat < 10.0.0
li_rc = loo_Http.ConnectToNewObject("Chilkat.Http")
if li_rc < 0 then
    destroy loo_Http
    MessageBox("Error","Connecting to COM object failed")
    return
end if

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

loo_SbResponseBody = create oleobject
// Use "Chilkat_9_5_0.StringBuilder" for versions of Chilkat < 10.0.0
li_rc = loo_SbResponseBody.ConnectToNewObject("Chilkat.StringBuilder")

li_Success = loo_Http.QuickGetSb("https://api.plivo.com/v1/Account/<auth_id>/Recording/{recording_id}/",loo_SbResponseBody)
if li_Success = 0 then
    Write-Debug loo_Http.LastErrorText
    destroy loo_Http
    destroy loo_SbResponseBody
    return
end if

Write-Debug "Response status code = " + string(loo_Http.LastStatus)
Write-Debug loo_SbResponseBody.GetAsString()


destroy loo_Http
destroy loo_SbResponseBody

Curl Command

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

Postman Collection Item JSON

{
  "name": "Retrieve a recording",
  "request": {
    "method": "GET",
    "header": [
    ],
    "url": {
      "raw": "https://api.plivo.com/v1/Account/{{auth_id}}/Recording/{recording_id}/",
      "protocol": "https",
      "host": [
        "api",
        "plivo",
        "com"
      ],
      "path": [
        "v1",
        "Account",
        "{{auth_id}}",
        "Recording",
        "{recording_id}",
        ""
      ]
    },
    "description": "The following API is used to retrieve a specific recording based on the ‘recording_id’.\n\nMore information can be found [here](https://www.plivo.com/docs/voice/api/recording#retrieve-a-recording)"
  },
  "response": [
    {
      "name": "Retrieve a recording",
      "originalRequest": {
        "method": "GET",
        "header": [
        ],
        "url": {
          "raw": "https://api.plivo.com/v1/Account/{{auth_id}}/Recording/{recording_id}/",
          "protocol": "https",
          "host": [
            "api",
            "plivo",
            "com"
          ],
          "path": [
            "v1",
            "Account",
            "{{auth_id}}",
            "Recording",
            "{recording_id}",
            ""
          ]
        }
      },
      "code": 200,
      "_postman_previewlanguage": "json",
      "header": [
      ],
      "cookie": [
      ],
      "body": "{\n    \"add_time\": \"2014-08-05 16:15:15.852059+05:30\",\n    \"api_id\": \"7abf0744-1ca0-11e4-a2d1-22000ac5040c\",\n    \"call_uuid\": \"c2c128e2-1c8c-11e4-9bff-1db8a9db0432\",\n    \"conference_name\": \"noname\",\n    \"recording_duration_ms\": \"345100.00000\",\n    \"recording_end_ms\": \"1407235509007.00000\",\n    \"recording_format\": \"mp3\",\n    \"recording_id\": \"c2186400-1c8c-11e4-a664-0026b945b52x\",\n    \"recording_start_ms\": \"1407235163907.00000\",\n    \"recording_type\": \"conference\",\n    \"recording_url\": \"http://s3.amazonaws.com/recordings_2013/c2186400-1c8c-11e4-a664-0026b945b52x.mp3\",\n    \"resource_uri\": \"/v1/Account/MAXXXXXXXXXXXXXXXXXX/Recording/c2186400-1c8c-11e4-a664-0026b945b52x/\"\n}"
    }
  ]
}