Start here
Answer the survey in a closing email
/v1/support/csaton https://api.auray.ai/v1The last click in a support conversation.
The last click in a support conversation. The token arrives only in the mail that closes a ticket, and only when the ticket was solved, was not spam or quarantined, and the requester wrote at least once. It is answered once; a second answer and an unknown token are answered identically, so nothing here can be used to test whether a token exists. No proof of work: unlike every other unauthenticated write under /v1/support this one cannot be aimed at a stranger, and taxing somebody for answering a question we asked them is the wrong trade.
#Authentication
No key needed — this document is public.
#Request
#Body
application/json, required.
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
token | string | yes | — | The 43-character token from the survey link. 0 to 64 characters. |
score | integer | yes | — | One to five. Anything else is refused. 1 to 5. |
comment | string | no | — | Optional. Kept with the score on the ticket, where support reads it. Sent again with the same score after the survey was answered, it is kept once — the page's second box — and a later one is not. 0 to 2000 characters. |
#Example request
curl -X POST https://api.auray.ai/v1/support/csat \
-H "content-type: application/json" \
-d '{
"token": "…",
"score": 1
}'const res = await fetch("https://api.auray.ai/v1/support/csat", {
method: "POST",
headers: {
"content-type": "application/json",
},
body: JSON.stringify({
"token": "…",
"score": 1
}),
});
console.log(await res.json());import requests
r = requests.post(
"https://api.auray.ai/v1/support/csat",
json={
"token": "…",
"score": 1
},
)
r.raise_for_status()
print(r.json())package main
import (
"bytes"
"fmt"
"io"
"net/http"
)
func main() {
body := []byte(`{
"token": "…",
"score": 1
}`)
req, err := http.NewRequest("POST", "https://api.auray.ai/v1/support/csat", bytes.NewReader(body))
if err != nil {
panic(err)
}
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/csat");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => json_encode([
"token" => "…",
"score" => 1,
], 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/csat")
req = Net::HTTP::Post.new(uri)
req["Content-Type"] = "application/json"
req.body = {
"token" => "…",
"score" => 1
}.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 = """
{
"token": "…",
"score": 1
}""";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.auray.ai/v1/support/csat"))
.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.Text;
using var client = new HttpClient();
using var request = new HttpRequestMessage(HttpMethod.Post, "https://api.auray.ai/v1/support/csat");
var body = """
{
"token": "…",
"score": 1
}
""";
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
#200 OK
Thank you. recorded is false when the token was unknown, or already answered (and, for a comment, already commented); the cases are deliberately indistinguishable.
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
recorded | boolean | no | — |
#400 Bad Request
support_score_invalid — the score is not a whole number from one to five. Nothing was recorded.
#404 Not Found
support_link_invalid — the token is not the shape of a survey link we issue. A well-formed token that is unknown or already answered is not refused: it is the 200 with recorded: false.
#429 Too Many Requests
Too many attempts.
#503 Service Unavailable
support_unavailable — the answer could not be recorded. Nothing was changed; send it again.
#Status codes
| Status | Meaning |
|---|---|
200 | Thank you. recorded is false when the token was unknown, or already answered (and, for a comment, already commented); the cases are deliberately indistinguishable. |
400 | support_score_invalid — the score is not a whole number from one to five. |
404 | support_link_invalid — the token is not the shape of a survey link we issue. |
429 | Too many attempts. |
503 | support_unavailable — the answer could not be recorded. |
Every refusal names its code, and every code is explained at Errors.