Call Detail Record

CDR2Browse

Returns information about a group of Call Detail Records or CDRs. CDRs are only generated for calls to and from the PSTN. There will be no records generated for SIP to SIP calling, which includes extension to extension dialing.

Authentication & Authorization

Authentication Authorization
Authenticated Session Account Admin

Request Parameters

Required Parameters Description
Action “Cdr2Browse”
SessionId Authenticated Session identifier.
One and Only One of the Following Required Parameters Description
AccountId A positive integer which references a unique Account.
OrganizationId A positive integer which references a unique Organization.
UserId A positive integer which references a unique User.
One and Only One of the Following Optional Parameters Default Description
MonthOffset 0 A month offset into the history. 0 = current month, -1 = last month, -2 = two months ago, …
StartDateTime & EndDateTime NA GNU DateTime range; StartDateTime <= DateTime < EndDateTime
StartCdrId & EndCdrId NA CdrId range; StartCdrId <= CdrId < EndCdrId
Optional Parameters Default Description
OrderBy DateTime CdrId | DateTime | Price
Limit 20 The maximum number of records to return.
Offset 0 The offset of the first record to return. The offset of the initial record is 0 (not 1).
CalcFound true Calculate how many records there would be in the result set, disregarding any Limit parameter.
Reverse false Used in conjunction with StartCdrId, lets you paginate backwards from that Cdr (non-inclusive).

Sample Request

cURL
1
2
3
4
curl -X POST \
--data \
'Action=Cdr2Browse&SessionId=iusj9dslgivu5vqsm28qq330k6&StartDateTime=2016-07-06T13:35:13%2B00:00&EndDateTime=2016-07-13T21:02:19%2B00:00&Limit=2&Offset=0&CalcFound=true&UserId=152255' \
https://api.onsip.com/api
JavaScript
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
var data = new FormData();
data.append('Action', 'Cdr2Browse');
data.append('SessionId', 'iusj9dslgivu5vqsm28qq330k6');
data.append('StartDateTime', '2016-07-06T13:35:13+00:00');
data.append('EndDateTime', '2016-07-13T21:02:19+00:00');
data.append('Limit', '2'); data.append('Offset', '0'); data.append('CalcFound', 'true'); data.append('UserId', '152255');
var xhr = new XMLHttpRequest(); xhr.open('POST', 'https://api.onsip.com/api', true); xhr.onload = function () { console.log(this.responseText); } xhr.send(data);

Sample Response

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
<Response xmlns="http://www.jnctn.net/ns/rest/2006-01">
   <Context>
      <Action>
         <IsCompleted>true</IsCompleted>
      </Action>
      <Request>
         <IsValid>true</IsValid>
         <DateTime>2017-01-16T21:39:12+00:00</DateTime>
         <Duration>12</Duration>
         <Parameters>
            <Parameter>
               <Name>Action</Name>
               <Value>Cdr2Browse</Value>
            </Parameter>
            <Parameter>
               <Name>SessionId</Name>
               <Value>iusj9dslgivu5vqsm28qq330k6</Value>
            </Parameter>
            <Parameter>
               <Name>StartDateTime</Name>
               <Value>2016-07-06T13:35:13+00:00</Value>
            </Parameter>
            <Parameter>
               <Name>EndDateTime</Name>
               <Value>2016-07-13T21:02:19+00:00</Value>
            </Parameter>
            <Parameter>
               <Name>Limit</Name>
               <Value>2</Value>
            </Parameter>
            <Parameter>
               <Name>Offset</Name>
               <Value>0</Value>
            </Parameter>
            <Parameter>
               <Name>CalcFound</Name>
               <Value>true</Value>
            </Parameter>
            <Parameter>
               <Name>UserId</Name>
               <Value>152255</Value>
            </Parameter>
            <Parameter>
               <Name>OrderBy</Name>
               <Value>DateTime DESC,CdrId DESC</Value>
            </Parameter>
            <Parameter>
               <Name>Reverse</Name>
               <Value>false</Value>
            </Parameter>
         </Parameters>
      </Request>
      <Session>
         <IsEstablished>true</IsEstablished>
         <SessionId>iusj9dslgivu5vqsm28qq330k6</SessionId>
         <UserId>152255</UserId>
         <Roles>
            <Role>
               <Name>Account Admin</Name>
            </Role>
         </Roles>
      </Session>
   </Context>
   <Result>
      <Cdr2Browse>
         <Cdrs Limit="2" LengthTotal="840" PriceTotal="0.4060000" CostTotal="0.4060000">
            <Cdr>
               <CdrId>2016070001312069</CdrId>
               <DateTime>2016-07-13T20:51:17+00:00</DateTime>
               <AccountId>22543</AccountId>
               <OrganizationId>25018</OrganizationId>
               <UserId>152255</UserId>
               <Routing>termination</Routing>
               <CallType>termination</CallType>
               <CallSubType />
               <CallerId>"test2" unavailable</CallerId>
               <Source>unavailable</Source>
               <Destination>16314870451</Destination>
               <E164>16314870451</E164>
               <Platform>onsip</Platform>
               <Disposition>answered</Disposition>
               <AnswerDateTime>2016-07-13T20:51:26+00:00</AnswerDateTime>
               <EndDateTime>2016-07-13T20:54:29+00:00</EndDateTime>
               <Length>240</Length>
               <Price>0.1160000</Price>
               <Cost>0.1160000</Cost>
            </Cdr>
            <Cdr>
               <CdrId>2016070001311113</CdrId>
               <DateTime>2016-07-13T20:49:34+00:00</DateTime>
               <AccountId>22543</AccountId>
               <OrganizationId>25018</OrganizationId>
               <UserId>152255</UserId>
               <Routing>termination</Routing>
               <CallType>termination</CallType>
               <CallSubType />
               <CallerId>"test2" unavailable</CallerId>
               <Source>unavailable</Source>
               <Destination>16314870451</Destination>
               <E164>16314870451</E164>
               <Platform>onsip</Platform>
               <Disposition>answered</Disposition>
               <AnswerDateTime>2016-07-13T20:49:43+00:00</AnswerDateTime>
               <EndDateTime>2016-07-13T20:50:36+00:00</EndDateTime>
               <Length>60</Length>
               <Price>0.0290000</Price>
               <Cost>0.0290000</Cost>
            </Cdr>
         </Cdrs>
      </Cdr2Browse>
   </Result>
</Response>

CDRSummary

Returns summary information about a group of Call Detail Records or CDRs. CDRs are only generated for calls to and from the PSTN. There will be no records generated for SIP to SIP calling, which includes extension to extension dialing. Summary Information includes number of calls made, what types of calls were made, and how much the calls cost.

Authentication & Authorization

Authentication Authorization
Authenticated Session Account Admin

Request Parameters

Required Parameters Description
Action “CdrSummary”
SessionId Authenticated Session identifier.
One and Only One of the Following Required Parameters Description
AccountId A positive integer which references a unique Account.
OrganizationId A positive integer which references a unique Organization.
UserId A positive integer which references a unique User.
One and Only One of the Following Optional Parameters Default Description
DateOffset 0 A month offset into the history. 0 = current month, -1 = last month, -2 = two months ago, …
StartDateTime & EndDateTime NA GNU DateTime range; StartDateTime <= DateTime < EndDateTime

Sample Request

cURL
1
2
3
4
curl -X POST \
--data \
'Action=CdrSummary&SessionId=iusj9dslgivu5vqsm28qq330k6&StartDateTime=2016-07-06T13:35:13%2B00:00&EndDateTime=2016-07-13T21:02:19%2B00:00&UserId=152255' \
https://api.onsip.com/api
JavaScript
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
var data = new FormData();
data.append('Action', 'CdrSummary');
data.append('SessionId', 'iusj9dslgivu5vqsm28qq330k6');
data.append('StartDateTime', '2016-07-06T13:35:13+00:00');
data.append('EndDateTime', '2016-07-13T21:02:19+00:00'); data.append('UserId', '152255');
var xhr = new XMLHttpRequest(); xhr.open('POST', 'https://api.onsip.com/api', true); xhr.onload = function () { console.log(this.responseText); } xhr.send(data);

Sample Response

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<Response xmlns="http://www.jnctn.net/ns/rest/2006-01">
   <Context>
      <Action>
         <IsCompleted>true</IsCompleted>
      </Action>
      <Request>
         <IsValid>true</IsValid>
         <DateTime>2017-01-16T21:54:32+00:00</DateTime>
         <Duration>14</Duration>
         <Parameters>
            <Parameter>
               <Name>Action</Name>
               <Value>CdrSummary</Value>
            </Parameter>
            <Parameter>
               <Name>SessionId</Name>
               <Value>iusj9dslgivu5vqsm28qq330k6</Value>
            </Parameter>
            <Parameter>
               <Name>StartDateTime</Name>
               <Value>2016-07-06T13:35:13+00:00</Value>
            </Parameter>
            <Parameter>
               <Name>EndDateTime</Name>
               <Value>2016-07-13T21:02:19+00:00</Value>
            </Parameter>
            <Parameter>
               <Name>UserId</Name>
               <Value>152255</Value>
            </Parameter>
         </Parameters>
      </Request>
      <Session>
         <IsEstablished>true</IsEstablished>
         <SessionId>iusj9dslgivu5vqsm28qq330k6</SessionId>
         <UserId>152255</UserId>
         <Roles>
            <Role>
               <Name>Account Admin</Name>
            </Role>
         </Roles>
      </Session>
   </Context>
   <Result>
      <CdrSummary>
         <CdrUserSummary UserId="152255">
            <ContactName>James Criscuolo</ContactName>
            <SubTotals>
               <SubTotal>
                  <Rate>Inbound</Rate>
                  <NumberOfCalls>0</NumberOfCalls>
                  <Length>0</Length>
                  <Price>0.0000000</Price>
               </SubTotal>
               <SubTotal>
                  <Rate>Toll Free Inbound</Rate>
                  <NumberOfCalls>1</NumberOfCalls>
                  <Length>0</Length>
                  <Price>0.0000000</Price>
               </SubTotal>
               <SubTotal>
                  <Rate>Outbound</Rate>
                  <NumberOfCalls>5</NumberOfCalls>
                  <Length>14</Length>
                  <Price>0.4060000</Price>
               </SubTotal>
               <SubTotal>
                  <Rate>Conference</Rate>
                  <NumberOfCalls>0</NumberOfCalls>
                  <Length>0</Length>
                  <Price>0.0000000</Price>
               </SubTotal>
               <SubTotal>
                  <Rate>Inbound Bridge</Rate>
                  <NumberOfCalls>0</NumberOfCalls>
                  <Length>0</Length>
                  <Price>0.0000000</Price>
               </SubTotal>
            </SubTotals>
            <Totals>
               <NumberOfCalls>6</NumberOfCalls>
               <Length>14</Length>
               <Price>0.4060000</Price>
            </Totals>
         </CdrUserSummary>
      </CdrSummary>
   </Result>
</Response>

Topics: Developer Docs