Agregar un comentario
POST/v1/tickets/{number}/commentsScope write
Agrega un comentario público a una solicitud en nombre de tu integración. Los agentes asignados reciben una notificación como con cualquier respuesta.
Parámetros de ruta
Sección titulada «Parámetros de ruta»| Nombre | Tipo | Descripción |
|---|---|---|
number obligatorio |
string |
Número de la solicitud, como GM-000123. |
Cuerpo de la petición
Sección titulada «Cuerpo de la petición»| Campo | Tipo | Descripción |
|---|---|---|
body obligatorio |
string |
Texto del comentario. Texto plano; se conservan los saltos de línea. De 1 a 20000 caracteres. |
{ "body": "The issue is back after the restart. Attaching the client log."}Respuesta
Sección titulada «Respuesta»201 Created · data
| Campo | Tipo | Descripción |
|---|---|---|
author |
object |
Quién lo escribió. |
author.name |
string |
Nombre en el idioma de Accept-Language. |
author.type |
string |
Uno de agent, contact, integration. |
body |
string |
Texto del comentario. |
createdAt |
date-time |
Cuándo se creó. |
id |
integer |
ID único. |
{ "data": { "id": 512, "body": "We replaced the VPN profile. Can you confirm it holds?", "author": { "type": "agent", "name": "Luis Gómez" }, "createdAt": "2026-12-06T15:40:00Z" }}Errores
Sección titulada «Errores»Todos los errores tienen la misma forma; en Errores están todas las claves.
Ejemplos de código
Sección titulada «Ejemplos de código»curl -X POST 'https://api.client.service-desk.goldmaster.io/v1/tickets/GM-000123/comments' \ -H "Authorization: Bearer $DUTY_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "body": "The issue is back after the restart. Attaching the client log."}'const response = await fetch('https://api.client.service-desk.goldmaster.io/v1/tickets/GM-000123/comments', { method: 'POST', headers: { Authorization: `Bearer ${process.env.DUTY_API_KEY}`, 'Content-Type': 'application/json', }, body: JSON.stringify({ "body": "The issue is back after the restart. Attaching the client log." }),});const body = await response.json();if (!response.ok) throw new Error(`${body.error}: ${body.message}`);console.log(body.data);import os
import requests
response = requests.request( "POST", "https://api.client.service-desk.goldmaster.io/v1/tickets/GM-000123/comments", headers={"Authorization": f"Bearer {os.environ['DUTY_API_KEY']}"}, json={ "body": "The issue is back after the restart. Attaching the client log." }, timeout=30,)response.raise_for_status()print(response.json()["data"])package main
import ( "fmt" "io" "net/http" "os" "strings")
func main() { payload := strings.NewReader(`{ "body": "The issue is back after the restart. Attaching the client log."}`) req, _ := http.NewRequest("POST", "https://api.client.service-desk.goldmaster.io/v1/tickets/GM-000123/comments", payload) req.Header.Set("Authorization", "Bearer "+os.Getenv("DUTY_API_KEY")) req.Header.Set("Content-Type", "application/json") res, err := http.DefaultClient.Do(req) if err != nil { panic(err) } defer res.Body.Close() data, _ := io.ReadAll(res.Body) fmt.Println(res.Status, string(data))}<?php$ch = curl_init('https://api.client.service-desk.goldmaster.io/v1/tickets/GM-000123/comments');curl_setopt_array($ch, [ CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_RETURNTRANSFER => true, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer ' . getenv('DUTY_API_KEY'), 'Content-Type: application/json', ], CURLOPT_POSTFIELDS => <<<'JSON'{ "body": "The issue is back after the restart. Attaching the client log."}JSON,]);$response = curl_exec($ch);$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);echo $status, PHP_EOL, $response;using System.Net.Http.Headers;
using var client = new HttpClient();using var request = new HttpRequestMessage(new HttpMethod("POST"), "https://api.client.service-desk.goldmaster.io/v1/tickets/GM-000123/comments");request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("DUTY_API_KEY"));request.Content = new StringContent(""" { "body": "The issue is back after the restart. Attaching the client log." } """, System.Text.Encoding.UTF8, "application/json");using var response = await client.SendAsync(request);Console.WriteLine($"{(int)response.StatusCode} {await response.Content.ReadAsStringAsync()}");import java.net.URI;import java.net.http.*;
HttpClient client = HttpClient.newHttpClient();HttpRequest request = HttpRequest.newBuilder(URI.create("https://api.client.service-desk.goldmaster.io/v1/tickets/GM-000123/comments")) .header("Authorization", "Bearer " + System.getenv("DUTY_API_KEY")) .header("Content-Type", "application/json") .method("POST", HttpRequest.BodyPublishers.ofString(""" { "body": "The issue is back after the restart. Attaching the client log." } """)) .build();var response = client.send(request, HttpResponse.BodyHandlers.ofString());System.out.println(response.statusCode() + " " + response.body());