Skip to main content
GET
/
comments
JavaScript
import Telnyx from 'telnyx';

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

const comments = await client.comments.list();

console.log(comments.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
)
comments = client.comments.list()
print(comments.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"),
)
comments, err := client.Comments.List(context.TODO(), telnyx.CommentListParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", comments.Data)
}
package com.telnyx.sdk.example;

import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.comments.CommentListParams;
import com.telnyx.sdk.models.comments.CommentListResponse;

public final class Main {
private Main() {}

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

CommentListResponse comments = client.comments().list();
}
}
require "telnyx"

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

comments = telnyx.comments.list

puts(comments)
<?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 {
$comments = $client->comments->list(
filter: [
'commentRecordID' => '8ffb3622-7c6b-4ccc-b65f-7a3dc0099576',
'commentRecordType' => 'sub_number_order',
],
);

var_dump($comments);
} catch (APIException $e) {
echo $e->getMessage();
}
telnyx comments list \
--api-key 'My API Key'
curl --request GET \
--url https://api.telnyx.com/v2/comments \
--header 'Authorization: Bearer <token>'
{
  "data": [
    {
      "id": "12ade33a-21c0-473b-b055-b3c836e1c292",
      "body": "Hi there, ....",
      "commenter": "user@company.com",
      "commenter_type": "user",
      "comment_record_type": "sub_number_order",
      "comment_record_id": "8ffb3622-7c6b-4ccc-b65f-7a3dc0099576",
      "read_at": "2018-01-01T00:00:00.000000Z",
      "created_at": "2018-01-01T00:00:00.000000Z",
      "updated_at": "2018-01-01T00:00:00.000000Z"
    }
  ],
  "meta": {
    "total_pages": 3,
    "total_results": 55,
    "page_number": 2,
    "page_size": 25
  }
}
{
"errors": [
{
"code": "10007",
"title": "Unexpected error",
"detail": "An unexpected error occured.",
"source": {
"pointer": "/base",
"parameter": "<string>"
},
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10015"
}
}
]
}
{
"errors": [
{
"code": "10009",
"title": "Authentication failed",
"detail": "Could not understand the provided credentials.",
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10009"
}
}
]
}
{
"errors": [
{
"code": "10007",
"title": "Unexpected error",
"detail": "An unexpected error occured.",
"source": {
"pointer": "/base",
"parameter": "<string>"
},
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10015"
}
}
]
}
{
"errors": [
{
"code": "10007",
"title": "Unexpected error",
"detail": "An unexpected error occured.",
"source": {
"pointer": "/base",
"parameter": "<string>"
},
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10015"
}
}
]
}
{
"errors": [
{
"code": "10007",
"title": "Unexpected error",
"detail": "An unexpected error occured.",
"source": {
"pointer": "/base",
"parameter": "<string>"
},
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10015"
}
}
]
}

Authorizations

Authorization
string
header
required

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

Query Parameters

filter
object

Consolidated filter parameter (deepObject style). Originally: filter[comment_record_type], filter[comment_record_id]

Response

An array of Comment Responses

data
object[]
meta
object