Skip to main content
GET
/
reports
/
mdrs
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.listMdrs();

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.list_mdrs()
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.ListMdrs(context.TODO(), telnyx.ReportListMdrsParams{})
	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.ReportListMdrsParams;
import com.telnyx.sdk.models.reports.ReportListMdrsResponse;

public final class Main {
    private Main() {}

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

        ReportListMdrsResponse response = client.reports().listMdrs();
    }
}
require "telnyx"

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

response = telnyx.reports.list_mdrs

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->listMdrs(
    id: 'e093fbe0-5bde-11eb-ae93-0242ac130002',
    cld: '+15551237654',
    cli: '+15551237654',
    direction: 'INBOUND',
    endDate: 'end_date',
    messageType: 'SMS',
    profile: 'My profile',
    startDate: 'start_date',
    status: 'DELIVERED',
  );

  var_dump($response);
} catch (APIException $e) {
  echo $e->getMessage();
}
telnyx reports list-mdrs \
  --api-key 'My API Key'
curl --request GET \
  --url https://api.telnyx.com/v2/reports/mdrs \
  --header 'Authorization: Bearer <token>'
{
  "data": [
    {
      "created_at": "2020-07-01T00:00:00-06:00",
      "profile_name": "configured-profile-name",
      "direction": "outbound",
      "parts": 2,
      "status": "DELIVERED",
      "cld": "+1555123456",
      "cli": "+1555123456",
      "rate": "0.05",
      "cost": "0.1",
      "currency": "USD",
      "id": "99b637f3-07fd-45ac-b9ca-b87208c24650",
      "message_type": "SMS",
      "record_type": "mdr_report"
    }
  ],
  "meta": {
    "total_pages": 3,
    "total_results": 55,
    "page_number": 2,
    "page_size": 25
  }
}
{
  "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

Pagination start date

end_date
string

Pagination end date

id
string

Filter results by identifier. Message uuid

Example:

"e093fbe0-5bde-11eb-ae93-0242ac130002"

direction
enum<string>

Filter results by direction. Direction (inbound or outbound)

Available options:
INBOUND,
OUTBOUND
Example:

"INBOUND"

profile
string

Filter results by profile. Name of the profile

Example:

"My profile"

cld
string

Filter results by cld. Destination number

Example:

"+15551237654"

cli
string

Filter results by cli. Origination number

Example:

"+15551237654"

status
enum<string>

Filter results by status. Message status

Available options:
GW_TIMEOUT,
DELIVERED,
DLR_UNCONFIRMED,
DLR_TIMEOUT,
RECEIVED,
GW_REJECT,
FAILED
Example:

"DELIVERED"

message_type
enum<string>

Filter results by message type. Type of message

Available options:
SMS,
MMS
Example:

"SMS"

Response

Successful

data
object[]
meta
object