Skip to main content
GET
/
reports
/
cdr_usage_reports
/
sync
JavaScript
import Telnyx from 'telnyx';

const client = new Telnyx({
  apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});

const response = await client.reports.cdrUsageReports.fetchSync({
  aggregation_type: 'NO_AGGREGATION',
  product_breakdown: 'NO_BREAKDOWN',
});

console.log(response.data);
import os
from telnyx import Telnyx

client = Telnyx(
    api_key=os.environ.get("TELNYX_API_KEY"),  # This is the default and can be omitted
)
response = client.reports.cdr_usage_reports.fetch_sync(
    aggregation_type="NO_AGGREGATION",
    product_breakdown="NO_BREAKDOWN",
)
print(response.data)
package main

import (
	"context"
	"fmt"

	"github.com/team-telnyx/telnyx-go"
	"github.com/team-telnyx/telnyx-go/option"
)

func main() {
	client := telnyx.NewClient(
		option.WithAPIKey("My API Key"),
	)
	response, err := client.Reports.CdrUsageReports.FetchSync(context.TODO(), telnyx.ReportCdrUsageReportFetchSyncParams{
		AggregationType:  telnyx.ReportCdrUsageReportFetchSyncParamsAggregationTypeNoAggregation,
		ProductBreakdown: telnyx.ReportCdrUsageReportFetchSyncParamsProductBreakdownNoBreakdown,
	})
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", response.Data)
}
package com.telnyx.sdk.example;

import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.reports.cdrusagereports.CdrUsageReportFetchSyncParams;
import com.telnyx.sdk.models.reports.cdrusagereports.CdrUsageReportFetchSyncResponse;

public final class Main {
    private Main() {}

    public static void main(String[] args) {
        TelnyxClient client = TelnyxOkHttpClient.fromEnv();

        CdrUsageReportFetchSyncParams params = CdrUsageReportFetchSyncParams.builder()
            .aggregationType(CdrUsageReportFetchSyncParams.AggregationType.NO_AGGREGATION)
            .productBreakdown(CdrUsageReportFetchSyncParams.ProductBreakdown.NO_BREAKDOWN)
            .build();
        CdrUsageReportFetchSyncResponse response = client.reports().cdrUsageReports().fetchSync(params);
    }
}
require "telnyx"

telnyx = Telnyx::Client.new(api_key: "My API Key")

response = telnyx.reports.cdr_usage_reports.fetch_sync(
  aggregation_type: :NO_AGGREGATION,
  product_breakdown: :NO_BREAKDOWN
)

puts(response)
<?php

require_once dirname(__DIR__) . '/vendor/autoload.php';

use Telnyx\Client;
use Telnyx\Core\Exceptions\APIException;

$client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API Key');

try {
  $response = $client->reports->cdrUsageReports->fetchSync(
    aggregationType: 'NO_AGGREGATION',
    productBreakdown: 'NO_BREAKDOWN',
    connections: [1234567890123],
    endDate: new \DateTimeImmutable('2020-07-01T00:00:00-06:00'),
    startDate: new \DateTimeImmutable('2020-07-01T00:00:00-06:00'),
  );

  var_dump($response);
} catch (APIException $e) {
  echo $e->getMessage();
}
telnyx reports:cdr-usage-reports fetch-sync \
  --api-key 'My API Key' \
  --aggregation-type NO_AGGREGATION \
  --product-breakdown NO_BREAKDOWN
curl --request GET \
  --url https://api.telnyx.com/v2/reports/cdr_usage_reports/sync \
  --header 'Authorization: Bearer <token>'
{
  "data": {
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "start_time": "2018-02-02T22:25:27.521Z",
    "end_time": "2018-02-02T22:25:27.521Z",
    "connections": [
      1234567890,
      9876543210
    ],
    "report_url": "http://portal.telnyx.com/downloads/report_name_8hvb45Gu.csv",
    "result": {},
    "created_at": "2018-02-02T22:25:27.521Z",
    "updated_at": "2018-02-02T22:25:27.521Z",
    "record_type": "cdr_usage_report"
  }
}
{
  "errors": [
    {
      "code": "10011",
      "title": "Bad Request",
      "detail": "Invalid parameter value"
    }
  ]
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Query Parameters

start_date
string<date-time>

Start of the date range filter (inclusive, ISO 8601).

Example:

"2020-07-01T00:00:00-06:00"

end_date
string<date-time>

End of the date range filter (inclusive, ISO 8601).

Example:

"2020-07-01T00:00:00-06:00"

aggregation_type
enum<string>
required

Type of aggregation to apply to the results.

Available options:
NO_AGGREGATION,
CONNECTION,
TAG,
BILLING_GROUP
Example:

"NO_AGGREGATION"

product_breakdown
enum<string>
required

Filter results by product breakdown.

Available options:
NO_BREAKDOWN,
DID_VS_TOLL_FREE,
COUNTRY,
DID_VS_TOLL_FREE_PER_COUNTRY
Example:

"NO_BREAKDOWN"

connections
number[]

Filter results by connection.

Example:
[1234567890123]

Response

Successful

data
object