SQL Server / Plivo REST API / List All Recordings
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 @queryParams int
-- Use "Chilkat_9_5_0.JsonObject" for versions of Chilkat < 10.0.0
EXEC @hr = sp_OACreate 'Chilkat.JsonObject', @queryParams OUT
EXEC sp_OAMethod @queryParams, 'UpdateInt', @success OUT, 'limit', 5
EXEC sp_OAMethod @queryParams, 'UpdateInt', @success OUT, 'offset', 0
DECLARE @resp int
EXEC sp_OAMethod @http, 'QuickRequestParams', @resp OUT, 'GET', 'https://api.plivo.com/v1/Account/<auth_id>/Recording/', @queryParams
EXEC sp_OAGetProperty @http, 'LastMethodSuccess', @iTmp0 OUT
IF @iTmp0 = 0
BEGIN
EXEC sp_OAGetProperty @http, 'LastErrorText', @sTmp0 OUT
PRINT @sTmp0
EXEC @hr = sp_OADestroy @http
EXEC @hr = sp_OADestroy @queryParams
RETURN
END
EXEC sp_OAGetProperty @resp, 'StatusCode', @iTmp0 OUT
PRINT @iTmp0
EXEC sp_OAGetProperty @resp, 'BodyStr', @sTmp0 OUT
PRINT @sTmp0
EXEC @hr = sp_OADestroy @resp
EXEC @hr = sp_OADestroy @http
EXEC @hr = sp_OADestroy @queryParams
END
GO
Curl Command
curl -G -d "limit=5"
-d "offset=0"
-u '{{auth_id}}:password'
https://api.plivo.com/v1/Account/<auth_id>/Recording/
Postman Collection Item JSON
{
"name": "List All Recordings",
"request": {
"method": "GET",
"header": [
],
"url": {
"raw": "https://api.plivo.com/v1/Account/{{auth_id}}/Recording/?limit=5&offset=0",
"protocol": "https",
"host": [
"api",
"plivo",
"com"
],
"path": [
"v1",
"Account",
"{{auth_id}}",
"Recording",
""
],
"query": [
{
"key": "subaccount",
"value": "SAXXXXXXXXXXXXX",
"description": "You can provide the auth_id of the subaccount in case you want to filter only recordings of a given subaccount.",
"disabled": true
},
{
"key": "call_uuid",
"value": "c2c128e2-1c8c-11e4-9bff-1db8a9db0432",
"description": "The call_uuid of the call to filter only recordings associated with a specific call.",
"disabled": true
},
{
"key": "add_time",
"value": "2014-08-05 16:15:15.85",
"description": "Filter recordings based on the time they were added.",
"disabled": true
},
{
"key": "limit",
"value": "5",
"description": "Used to display the number of results per page. The maximum number of results that can be fetched is 20."
},
{
"key": "offset",
"value": "0",
"description": "Denotes the number of value items by which the results should be offset. Eg:- If the result contains a 1000 values and limit is set to 10 and offset is set to 705, then values 706 through 715 are displayed in the results. This parameter is also used for pagination of the results."
}
]
},
"description": "This method lists the recordings that are available in your account.\n\nBelow is the list of arguments that can be passed in this API request, more information can be found [here](https://www.plivo.com/docs/voice/api/recording#list-all-recordings)\n\n| Arguments | Description | Required/Conditional/Optional |\n| :--- | :----: | ---: |\n| subaccount | You can provide the auth_id of the subaccount in case you want to filter only recordings of a given subaccount.| Optional |\n| call_uuid | The call_uuid of the call to filter only recordings associated with a specific call.| Optional |\n| add_time | Filter recordings based on the time they were added.<br />add_time__gt: gt stands for greater than. The format expected is YYYY-MM-DD HH:MM[:ss[.uuuuuu]]. Eg:- To get all recordings that started after 2012-03-21 11:47, use add_time__gt=2012-03-21 11:47<br />add_time__gte: gte stands for greater than or equal. The format expected is YYYY-MM-DD HH:MM[:ss[.uuuuuu]]. Eg:- To get all recordings that started after or exactly at 2012-03-21 11:47[:30], use add_time__gte=2012-03-21 11:47[:30]<br />add_time__lt: lt stands for lesser than. The format expected is YYYY-MM-DD HH:MM[:ss[.uuuuuu]]. Eg:- To get all recordings that started before 2012-03-21 11:47, use add_time__lt=2012-03-21 11:47<br />add_time__lte: lte stands for lesser than or equal. The format expected is YYYY-MM-DD HH:MM[:ss[.uuuuuu]]. Eg:- To get all recordings that started before or exactly at 2012-03-21 11:47[:30], use add_time__lte=2012-03-21 11:47[:30] | Optional |\n| limit | Used to display the number of results per page. The maximum number of results that can be fetched is 20.| Optional |\n| offset | Denotes the number of value items by which the results should be offset. Eg:- If the result contains a 1000 values and limit is set to 10 and offset is set to 705, then values 706 through 715 are displayed in the results. This parameter is also used for pagination of the results.| Optional |"
},
"response": [
{
"name": "List All Recordings",
"originalRequest": {
"method": "GET",
"header": [
],
"url": {
"raw": "https://api.plivo.com/v1/Account/{{auth_id}}/Recording/?limit=5&offset=0",
"protocol": "https",
"host": [
"api",
"plivo",
"com"
],
"path": [
"v1",
"Account",
"{{auth_id}}",
"Recording",
""
],
"query": [
{
"key": "subaccount",
"value": "SAXXXXXXXXXXXXX",
"description": "You can provide the auth_id of the subaccount in case you want to filter only recordings of a given subaccount.",
"disabled": true
},
{
"key": "call_uuid",
"value": "c2c128e2-1c8c-11e4-9bff-1db8a9db0432",
"description": "The call_uuid of the call to filter only recordings associated with a specific call.",
"disabled": true
},
{
"key": "add_time",
"value": "2014-08-05 16:15:15.85",
"description": "Filter recordings based on the time they were added.",
"disabled": true
},
{
"key": "limit",
"value": "5",
"description": "Used to display the number of results per page. The maximum number of results that can be fetched is 20."
},
{
"key": "offset",
"value": "0",
"description": "Denotes the number of value items by which the results should be offset. Eg:- If the result contains a 1000 values and limit is set to 10 and offset is set to 705, then values 706 through 715 are displayed in the results. This parameter is also used for pagination of the results."
}
]
}
},
"code": 200,
"_postman_previewlanguage": "json",
"header": [
],
"cookie": [
],
"body": "{\n \"api_id\": \"ff25223a-1c9f-11e4-80aa-12313f048015\",\n \"meta\": {\n \"limit\": 3,\n \"next\": \"/v1/Account/MAXXXXXXXXXXXXXXXXXX/Recording/?limit=3&offset=3\",\n \"offset\": 0,\n \"previous\": null,\n \"total_count\": 948\n },\n \"objects\": [\n {\n \"add_time\": \"2014-08-05 16:15:15.852059+05:30\",\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-1124-a664-0026b945b522\",\n \"recording_start_ms\": \"1407235163907.00000\",\n \"recording_type\": \"conference\",\n \"recording_url\": \"http://s3.amazonaws.com/recordings_2013/c2186400-1c8c-1124-a664-0026b945b522.mp3\",\n \"resource_uri\": \"/v1/Account/MAXXXXXXXXXXXXXXXXXX/Recording/c2186400-1c8c-1124-a664-0026b945b522/\"\n },\n {\n \"add_time\": \"2014-08-05 16:05:21.993853+05:30\",\n \"call_uuid\": \"fc773e88-1c8b-11e4-b25a-0fe7bcc54670\",\n \"conference_name\": \"noname\",\n \"recording_duration_ms\": \"90700.00000\",\n \"recording_end_ms\": \"1407234920253.00000\",\n \"recording_format\": \"mp3\",\n \"recording_id\": \"fc2716b0-1c8b-11e4-bwad-842b2b17453e\",\n \"recording_start_ms\": \"1407234829553.00000\",\n \"recording_type\": \"conference\",\n \"recording_url\": \"http://s3.amazonaws.com/recordings_2013/fc2716b0-1c8b-11e4-bwad-842b2b17453e.mp3\",\n \"resource_uri\": \"/v1/Account/MAXXXXXXXXXXXXXXXXXX/Recording/fc2716b0-1c8b-11e4-bwad-842b2b17453e/\"\n }\n ]\n}"
}
]
}