SQL Server / Plivo REST API / Retrieve a recording
Back to Collection Items
-- Important: See this note about string length limitations for strings returned by sp_OAMethod calls.
--
CREATE PROCEDURE ChilkatSample
AS
BEGIN
DECLARE @hr int
DECLARE @iTmp0 int
-- Important: Do not use nvarchar(max). See the warning about using nvarchar(max).
DECLARE @sTmp0 nvarchar(4000)
-- This example assumes the Chilkat API to have been previously unlocked.
-- See Global Unlock Sample for sample code.
DECLARE @http int
-- Use "Chilkat_9_5_0.Http" for versions of Chilkat < 10.0.0
EXEC @hr = sp_OACreate 'Chilkat.Http', @http OUT
IF @hr <> 0
BEGIN
PRINT 'Failed to create ActiveX component'
RETURN
END
DECLARE @success int
EXEC sp_OASetProperty @http, 'BasicAuth', 1
EXEC sp_OASetProperty @http, 'Login', '{{auth_id}}'
EXEC sp_OASetProperty @http, 'Password', 'password'
DECLARE @sbResponseBody int
-- Use "Chilkat_9_5_0.StringBuilder" for versions of Chilkat < 10.0.0
EXEC @hr = sp_OACreate 'Chilkat.StringBuilder', @sbResponseBody OUT
EXEC sp_OAMethod @http, 'QuickGetSb', @success OUT, 'https://api.plivo.com/v1/Account/<auth_id>/Recording/{recording_id}/', @sbResponseBody
IF @success = 0
BEGIN
EXEC sp_OAGetProperty @http, 'LastErrorText', @sTmp0 OUT
PRINT @sTmp0
EXEC @hr = sp_OADestroy @http
EXEC @hr = sp_OADestroy @sbResponseBody
RETURN
END
EXEC sp_OAGetProperty @http, 'LastStatus', @iTmp0 OUT
PRINT 'Response status code = ' + @iTmp0
EXEC sp_OAMethod @sbResponseBody, 'GetAsString', @sTmp0 OUT
PRINT @sTmp0
EXEC @hr = sp_OADestroy @http
EXEC @hr = sp_OADestroy @sbResponseBody
END
GO
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}"
}
]
}