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

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

const comment = await client.comments.retrieve('id');

console.log(comment.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
)
comment = client.comments.retrieve(
"id",
)
print(comment.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"),
)
comment, err := client.Comments.Get(context.TODO(), "id")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", comment.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.CommentRetrieveParams;
import com.telnyx.sdk.models.comments.CommentRetrieveResponse;

public final class Main {
private Main() {}

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

CommentRetrieveResponse comment = client.comments().retrieve("id");
}
}
require "telnyx"

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

comment = telnyx.comments.retrieve("id")

puts(comment)
<?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 {
$comment = $client->comments->retrieve('id');

var_dump($comment);
} catch (APIException $e) {
echo $e->getMessage();
}
telnyx comments retrieve \
--api-key 'My API Key' \
--id id
curl --request GET \
--url https://api.telnyx.com/v2/comments/{id} \
--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"
  }
}
{
"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.

Path Parameters

id
string
required

The comment ID.

Response

A Comment Response

data
object