Sorting Information
HTTP GET. You can use the SortBy GET query parameter to set which attribute you want to sort by and in which direction; direction can either be 'asc' for ascending and 'desc' for descending sort ordering. Use the format: SortBy=<sorting attribute> :<direction>. If no direction parameter is provided, the listing of recordings is sorted by the attribute in ascending order.
Below you can find the possible attributes you can sort by:

SortBy Attributes

Parameter
Description
DateCreated
Sort by the date in which the recording was created.
Duration
Sort by the duration of the recording.
CallSid
Sort by the CallSid of the recording, which points to the call to which the recording is related to.

Example

The command below will return recordings sorted by the creation date in ascending order using SortBy parameter:
CURL
1
curl -X GET https://api.teleapi.net/call/2012-04-24/"Accounts/ACCOUNT_SID/Recordings.xml?SortBy=DateCreated:asc' \
2
-u 'teleapi-Token
Copied!
The result of the SortBy parameter:
1
{
2
"page": 0,
3
"num_pages": 12,
4
"page_size": 50,
5
"total": 641,
6
"start": "0",
7
"end": "49",
8
"uri": "/call/2012-04-24/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Recordings",
9
"first_page_uri": "/call/2012-04-24/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Recordings?Page=0&PageSize=50",
10
"previous_page_uri": "null",
11
"next_page_uri": "/call/2012-04-24/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Recordings?Page=1&PageSize=50&AfterSid=REb4c4c07b59c646cab9d3869c469657bf",
12
"last_page_uri": "/call/2012-04-24/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Recordings?Page=12&PageSize=50",
13
"recordings": [
14
{
15
"sid": "RE054a9790bcc0474fb8f79b5766d86888",
16
"date_created": "Fri, 25 Mar 2016 14:32:14 +0000",
17
"date_updated": "Tue, 16 Jan 2018 10:34:48 +0000",
18
"account_sid": "AC61148eb9d61281750ccc0e13c6094fe1",
19
"call_sid": "CAa1e8f6d62dd444139bfe26614ba3908b",
20
"duration": "6.06275",
21
"api_version": "2012-04-24",
22
"uri": "/2012-04-24/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Recordings/RE054a9790bcc0474fb8f79b5766d86888.json",
23
"file_uri": "/call/2012-04-24/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Recordings/RE054a9790bcc0474fb8f79b5766d86888.wav"
24
},
25
{
26
"sid": "RE3be0e3b429194b90a488c38e0c2d5f24",
27
"date_created": "Fri, 25 Mar 2016 15:40:39 +0000",
28
"date_updated": "Tue, 16 Jan 2018 10:34:48 +0000",
29
"account_sid": "AC61148eb9d61281750ccc0e13c6094fe1",
30
"call_sid": "CA018f5d608c814c278bac005edd171085",
31
"duration": "5.74275",
32
"api_version": "2012-04-24",
33
"uri": "/2012-04-24/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Recordings/RE3be0e3b429194b90a488c38e0c2d5f24.json",
34
"file_uri": "/call/2012-04-24/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Recordings/RE3be0e3b429194b90a488c38e0c2d5f24.wav"
35
},
36
{
37
"sid": "REXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
38
"date_created": "Mon, 27 Jun 2016 14:42:12 +0000",
39
"date_updated": "Tue, 16 Jan 2018 10:34:48 +0000",
40
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
41
"call_sid": "CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
42
"duration": "5.36275",
43
"api_version": "2012-04-24",
44
"uri": "/2012-04-24/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Recordings/REa793b3dc65e14d95b4ad238fb38bed0a.json",
45
"file_uri": "/call/2012-04-24/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Recordings/REa793b3dc65e14d95b4ad238fb38bed0a.wav"
46
}
47
]
48
}
Copied!
Copy link