Start here
Write back on a support request
/v1/support/tickets/{reference}/messageson https://api.auray.ai/v1Add to one of the signed-in account's own requests, as replying to our mail does: the next message of the conversation, and a solved, closed or waiting request opened again.
Add to one of the signed-in account's own requests, as replying to our mail does: the next message of the conversation, and a solved, closed or waiting request opened again. Another account's reference is not found. Called by the desktop for the person signed in; a key you hold is refused 403 support_session_only, since it is not the person asking. Without the desktop, the help form (POST /support/requests) needs no key at all.
#Authentication
Authorization: Bearer auray_sk_… — The desktop's own session key, signed in — a key you hold is refused 403 support_session_only. Without the desktop, the help form needs no key.
#Request
#Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
reference | string | yes | The request's reference, as GET /support/tickets lists it. |
#Body
application/json, required.
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
message | string | yes | — | 1 to 20000 characters. |
#Example request
curl -X POST https://api.auray.ai/v1/support/tickets/…/messages \
-H "Authorization: Bearer $AURAY_API_KEY" \
-H "content-type: application/json" \
-d '{
"message": "…"
}'const res = await fetch("https://api.auray.ai/v1/support/tickets/…/messages", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.AURAY_API_KEY}`,
"content-type": "application/json",
},
body: JSON.stringify({
"message": "…"
}),
});
console.log(await res.json());import os, requests
r = requests.post(
"https://api.auray.ai/v1/support/tickets/…/messages",
headers={"Authorization": f"Bearer {os.environ['AURAY_API_KEY']}"},
json={
"message": "…"
},
)
r.raise_for_status()
print(r.json())package main
import (
"bytes"
"fmt"
"io"
"net/http"
"os"
)
func main() {
body := []byte(`{
"message": "…"
}`)
req, err := http.NewRequest("POST", "https://api.auray.ai/v1/support/tickets/…/messages", bytes.NewReader(body))
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("AURAY_API_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
out, _ := io.ReadAll(res.Body)
fmt.Println(res.Status, string(out))
}<?php
$ch = curl_init("https://api.auray.ai/v1/support/tickets/…/messages");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer " . getenv("AURAY_API_KEY"),
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => json_encode([
"message" => "…",
], JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE),
]);
$response = curl_exec($ch);
echo curl_getinfo($ch, CURLINFO_HTTP_CODE), " ", $response, PHP_EOL;require "net/http"
require "json"
uri = URI("https://api.auray.ai/v1/support/tickets/…/messages")
req = Net::HTTP::Post.new(uri)
req["Authorization"] = "Bearer #{ENV.fetch("AURAY_API_KEY")}"
req["Content-Type"] = "application/json"
req.body = {
"message" => "…"
}.to_json
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }
puts res.code, res.bodyimport java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Main {
public static void main(String[] args) throws Exception {
String body = """
{
"message": "…"
}""";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.auray.ai/v1/support/tickets/…/messages"))
.header("Authorization", "Bearer " + System.getenv("AURAY_API_KEY"))
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString(body))
.build();
HttpResponse<String> response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode() + " " + response.body());
}
}using System.Net.Http.Headers;
using System.Text;
using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization =
new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("AURAY_API_KEY"));
using var request = new HttpRequestMessage(HttpMethod.Post, "https://api.auray.ai/v1/support/tickets/…/messages");
var body = """
{
"message": "…"
}
""";
request.Content = new StringContent(body, Encoding.UTF8, "application/json");
using var response = await client.SendAsync(request);
Console.WriteLine($"{(int)response.StatusCode} {await response.Content.ReadAsStringAsync()}");#Responses
#201 Created
Added.
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
object | string | yes | — | One of "support_message". |
reference | string | yes | — | |
seq | integer | yes | — | |
status | string | yes | — | One of "new", "open", "pending", "on_hold", "solved", "closed". |
Headers:
| Header | Description |
|---|---|
RateLimit-Limit | Burst capacity. |
RateLimit-Remaining | |
RateLimit-Reset | Seconds until refill. |
X-Request-Id |
#400 Bad Request
support_message_invalid, invalid_body or invalid_json.
The error body: error, message, docs (the entry that explains it) and request_id.
#401 Unauthorized
missing_authorization, invalid_api_key, key_revoked or key_expired.
The error body: error, message, docs (the entry that explains it) and request_id.
#403 Forbidden
support_session_only — this is the desktop's door.
The error body: error, message, docs (the entry that explains it) and request_id.
#404 Not Found
not_found — the account has no request with that reference.
The error body: error, message, docs (the entry that explains it) and request_id.
#413 Payload Too Large
body_too_large — the body must be at most 65536 bytes.
The error body: error, message, docs (the entry that explains it) and request_id.
#429 Too Many Requests
support_rate_limited — this account has written several times just now — or rate_limited, the key's write bucket.
The error body: error, message, docs (the entry that explains it) and request_id.
#503 Service Unavailable
support_disabled, support_not_configured or support_unavailable.
The error body: error, message, docs (the entry that explains it) and request_id.
#Status codes
| Status | Meaning |
|---|---|
201 | Added. |
400 | support_message_invalid, invalid_body or invalid_json. |
401 | missing_authorization, invalid_api_key, key_revoked or key_expired. |
403 | support_session_only — this is the desktop's door. |
404 | not_found — the account has no request with that reference. |
413 | body_too_large — the body must be at most 65536 bytes. |
429 | support_rate_limited — this account has written several times just now — or rate_limited, the key's write bucket. |
503 | support_disabled, support_not_configured or support_unavailable. |
Every refusal names its code, and every code is explained at Errors.