Required parameters for the request:

Parameters you can export from your project statistics.

Example for Node.js:

const https = require('https');
const config = {
host: 'api.ringostat.net',
path: '/calls/list?export_type=json&from=2019-06-01%2000:00:00&to=2019-06-18%2023:59:59­&fields=calldate,caller,dst,disposition,billsec,utm_source,utm_medium,recording',
method: 'GET',
headers: {
'Content-Type': 'application/json',
'Auth-key': 'unique_auth_key_value'
}
};
const callback = response => {
let result = Buffer.alloc(0);
response.on('data', chunk => {
result = Buffer.concat([ result, chunk ]);
});
response.on('end', () => {
//handle response
})
};
const request = https.request(config, callback);
request.end();

Example for Axios.js:

const axios = require('axios');
axios({
url: 'https://api.ringostat.net/calls/list',
method: 'GET',
headers: {
'Content-Type': 'application/json; charset=utf-8',
'Auth-key': 'unique_auth_key_value'
},
params: JSON.stringify({
'export_type': 'json',
'from': '2019-06-01 00:00:00',
'to': '2019-06-18 23:59:59',
'fields': 'calldate,caller,dst,disposition,billsec,utm_source,utm_medium,recording'
})
}).then(response => {
//handle response
}).catch(error => {
//handle error
})

Example for cURL:

curl "https://api.ringostat.net/calls/list?export_type=json&from=2019-06-01 00:00:00&to=2019-06-18 23:59:59&fields=calldate,caller,dst,disposition,billsec,utm_source,utm_medium,recording" \
-H "Content-Type: application/json" \
-H "Auth-key: unique_auth_key_value"

Result:

Did this answer your question?