Exporting Call Logs (CDR) - Including Sub-Accounts (for channel partners) [URL]

Application developers may wish to access call logs from a Neural termiantion or PBX account via API.   This article outlines how to access this data in CSV format via either HTTP or HTTPS via a simple REST request.

 

The URL and Fields 

You can export your call logs via URL using the following string.  Replace the values in bold with those appropriate for your query.

 

https://voip.neural.net.au:15000/get/report-export-<direction>-subs&user=<user>&pass=<password>&repType=custom&download=true&inline=true&fromTime=123456789&toTime=123456789

 

Direction:

Inbound or outbound call logs.  One of:

in - Inbound call logs

out - Outbound call logs

 

User:  

Your portal username

 

Password:

Your portal password

 

fromTime / toTime:

Unix timestamp of the start and end times for the calls to report on.  Most programming languages have a function to report their native date/time format into a unix timestamp.

You can learn more about the unix timestamp format in Wikipedia.

Alternatively you can use our standard call log export command, which has pre-defined time periods.

 

Inline

Determines whether the response will be 'inline' data or 'attachment' data.  Inline data returns the CSV data as the inline HTML reponse.  If you remove this section of the URL, data will instead be sent in attachment format, which forces the browser to treat the CSV as a file download, rather than a web page.  Most retrieval methods (cURL, wget, etc.) prefer inline.

 

Example

A working example would look something like...

https://voip.neural.net.au:15000/get/report-export-in-subs&user=test&pass=s3cr3t&repType=30day&download=true&inline=true

 

 

Sample of Returned Data (Outbound)

The data will be returned in CSV format, as shown here:

'2014-02-02 19:12:39', '1234',0900001,0731714300,0731714301,'QLD Brisbane',86,TBD

 

The fields are:

  1. Date / time
  2. Customer account code
  3. Originating device account
  4. Destination number
  5. Caller ID
  6. Destination location
  7. Call duration (in seconds)
  8. Billing (in cents, TBD until post-billing)

 

 

Sample of Returned Data (Inbound)

The data will be returned in CSV format, as shown here:

'2014-02-03 08:47:33','1234',0731714300,'ACT|090001',0731714301,'QLD Brisbane',76,TBD

 

The fields are:

  1. Date / time
  2. Customer account code
  3. Receiving number (DID that was called)
  4. Route taken (pipe '|' delimited)
  5. Caller ID
  6. Caller ID location
  7. Call duration (in seconds)
  8. Billing (in cents, TBD until post-billing)

 

 

 

HTTP Alternative 

If HTTPS is unsuitable for your application, the same API is also available on HTTP.  Simply remove the 's' from https and change the port to 16000.

 

For example:   

http://voip.neural.net.au:16000/get/report-export-out-subs&user=test&pass=s3cr3t&repType=live&download=true&inline=true

 

Some development environments (such as .NET) don't always get along well with HTTPS, so this can be used as an alternative.

 

 

Sample Code 

 Sample code for this function is also available in the knowledge base.

 

Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.
Powered by Zendesk