Downloading CDRs

The example below demonstrates how to download CDRs from the API for storage and processing locally.

On the initial request, download the most current CDRs for the current date - this will enable you to get the ID of the most recent call on your account. If you have more than limit number of calls you will need to include this and the offset parameter until you reach the most recent call:

int CDRUID optionalThe CDRUID, can be retrieved from a the GetCDRs function.
string CDRRef optionalThe CDRUID, can be retrieved from a the GetCDRs function or sent via a webhook (if configured).

Request

<?xml version="1.0"?>
<NoveroRequest>
  <Request target="Auth" name="SessionLogin" id="SessionRequest">
    <Username>[email protected]</Username>
    <Password>secretpassword</Password>
    <VKey>a9d64e4c3289e7a14b51baf8adfec60a</VKey>
  </Request>
  <Request target="NoveroCDR" name="GetCDRs" id="Request1">
    <StartDate>2016-05-23</StartDate>
    <EndDate>2016-05-24</EndDate>
  </Request>
</NoveroRequest>

Response

<?xml version="1.0"?>
<NoveroResponse>
  <Response target="Auth" name="SessionLogin" Code="200" RequestId="SessionRequest">
    <SessionId>676fb75612b1e3a5691f4969f6503378</SessionId>
  </Response>
  <Response target="NoveroCDR" name="GetCDRs" Code="200" RequestId="Request1">
    <CDRs>
      <CDR>
        <uid>108119862</uid>
        <ref>!5224557B6062F</ref>
        <calldate>2013-09-02</calldate>
        <calltime>10:08:11</calltime>
        <anumber>1245123123</anumber>
        <anumber_location>UK Chelmsford</anumber_location>
        <bnumber>1211234567</bnumber>
        <alias>-</alias>
        <dialled>V:[email protected]</dialled>
        <dialled_location>Voice to Email</dialled_location>
        <duration>15</duration>
        <ring_time>0</ring_time>
        <user_cost>0.005</user_cost>
        <reason>1</reason>
        <reason_q805>1</reason_q805>
      </CDR>
      <CDR>
        <uid>108139023</uid>
        <ref>!522485C6323B</ref>
        <calldate>2013-09-02</calldate>
        <calltime>13:34:14</calltime>
        <anumber>1245123123</anumber>
        <anumber_location>UK Chelmsford</anumber_location>
        <bnumber>1211234567</bnumber>
        <alias>-</alias>
        <dialled>447512345678</dialled>
        <dialled_location>UK O2 Mobile</dialled_location>
        <duration>21</duration>
        <ring_time>14</ring_time>
        <user_cost>0.026</user_cost>
        <reason>1</reason>
        <reason_q805>1</reason_q805>
      </CDR>
    </CDRs>
  </Response>
</NoveroResponse>

The field of the last record should then be stored locally. It can then be used on subsequent requests to download the most recent CDRs since your last request using the parameter:

Request

<?xml version="1.0"?>
<NoveroRequest>
  <Request target="Auth" name="SessionLogin" id="SessionRequest">
    <Username>[email protected]</Username>
    <Password>secretpassword</Password>
    <VKey>a9d64e4c3289e7a14b51baf8adfec60a</VKey>
  </Request>
  <Request target="NoveroCDR" name="GetCDRs" id="Request1">
    <LastId>108139023</LastId>
  </Request>
</NoveroRequest>

Response

<?xml version="1.0"?>
<NoveroResponse>
  <Response target="Auth" name="SessionLogin" Code="200" RequestId="SessionRequest">
    <SessionId>1df9979b192955eb973e21a4103306ec</SessionId>
  </Response>
  <Response target="NoveroCDR" name="GetCDRs" Code="200" RequestId="Request1">
    <CDRs>
      <CDR>
        <uid>108183829</uid>
        <ref>!5225936BA6928</ref>
        <calldate>2013-09-03</calldate>
        <calltime>08:44:43</calltime>
        <anumber>1245123123</anumber>
        <anumber_location>UK Chelmsford</anumber_location>
        <bnumber>1211234567</bnumber>
        <alias>-</alias>
        <dialled>0</dialled>
        <dialled_location>Unknown</dialled_location>
        <duration>0</duration>
        <ring_time>0</ring_time>
        <user_cost>0.000</user_cost>
        <reason>1015</reason>
        <reason_q805>487</reason_q805>
      </CDR>
    </CDRs>
  </Response>
</NoveroResponse>