Download OpenAPI specification:Download

Call Report

Get call reports from the Sinch platform. Get call data for a specific user in the last 30 days, the number of calls, and more.

Get user call report

Gets the aggregated call data for a specific user for a duration of up to 30 days.

Request
Security:
Basic
or
Signed
path Parameters
type
required
string

The type of endpoint on which you want to report. The value can be either number or username.

Example: number
endpoint
required
string

The value of the endpoint of the call. For calls on the PSTN, this is a phone number. For app-to-app calls, this is a username.

Example: +46730170101
domain
string

An optional parameter that specifies the terminating pattern. Can be either data or pstn.

Example: data
Responses
200

A success response, or an Error.

Response Schema: application/json
success
integer

The number of successful calls.

duration
integer

The sum of all the calls in the report in seconds.

failed
integer

The number of failed calls.

start
string

The date and time of the first call in the report.

get/users/{type}/{endpoint}/calls/{domain}
Request samples
import fetch from 'node-fetch';

async function run() {
  const type = 'YOUR_type_PARAMETER';
  const endpoint = 'YOUR_endpoint_PARAMETER';
  const domain = 'YOUR_domain_PARAMETER';
  const resp = await fetch(
    `https://reportingapi.sinch.com/v1/users/${type}/${endpoint}/calls/${domain}`,
    {
      method: 'GET',
      headers: {
        Authorization: 'Basic ' + Buffer.from('<username>:<password>').toString('base64')
      }
    }
  );

  const data = await resp.text();
  console.log(data);
}

run();
Response samples
application/json
{
  • "success": 3,
  • "duration": 753,
  • "failed": 0,
  • "start": "2022-04-28T12:00:00Z"
}

Get call counts

Number of ongoing calls. The system updates the value of the counter every two minutes. The result value depends on how many calls were ongoing when the system updated the counter, and not when the request to the API was made.

Request
Security:
Basic
or
Signed
path Parameters
id
required
string

A predefined ID string. This must be set up in cooperation with the Sinch support team.

Example: currentCalls
Responses
200

A success response, or an Error.

Response Schema: application/json
value
number

The current value of the counter.

modified
string

Shows the date and time of the last update to the counter.

get/counters/{id}
Request samples
import fetch from 'node-fetch';

async function run() {
  const id = 'YOUR_id_PARAMETER';
  const resp = await fetch(
    `https://reportingapi.sinch.com/v1/counters/${id}`,
    {
      method: 'GET',
      headers: {
        Authorization: 'Basic ' + Buffer.from('<username>:<password>').toString('base64')
      }
    }
  );

  const data = await resp.text();
  console.log(data);
}

run();
Response samples
application/json
{
  • "value": 12384955,
  • "modified": "2022-04-28T12:00:00Z"
}

Get service status

Gets the current status of a predefined service.

Request
Security:
Basic
or
Signed
path Parameters
id
required
string

A predefined ID string. This must be set up in cooperation with the Sinch support team.

Example: currentCalls
Responses
200

A success response, or an Error.

Response Schema: application/json
status
string

Shows the current status of the service.

Enum: Description
up

The service is available.

down

The service is unavailable.

get/services/{id}
Request samples
import fetch from 'node-fetch';

async function run() {
  const id = 'YOUR_id_PARAMETER';
  const resp = await fetch(
    `https://reportingapi.sinch.com/v1/services/${id}`,
    {
      method: 'GET',
      headers: {
        Authorization: 'Basic ' + Buffer.from('<username>:<password>').toString('base64')
      }
    }
  );

  const data = await resp.text();
  console.log(data);
}

run();
Response samples
application/json
{
  • "status": "up"
}