cURL
curl --request POST \
--url https://api.example.com/v1/account/support/tickets \
--header 'Content-Type: application/json' \
--header 'X-CSRF-Token: <x-csrf-token>' \
--data '
{
"subject": "<string>",
"message": "<string>"
}
'import requests
url = "https://api.example.com/v1/account/support/tickets"
payload = {
"subject": "<string>",
"message": "<string>"
}
headers = {
"X-CSRF-Token": "<x-csrf-token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-CSRF-Token': '<x-csrf-token>', 'Content-Type': 'application/json'},
body: JSON.stringify({subject: '<string>', message: '<string>'})
};
fetch('https://api.example.com/v1/account/support/tickets', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/v1/account/support/tickets",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'subject' => '<string>',
'message' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-CSRF-Token: <x-csrf-token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/account/support/tickets"
payload := strings.NewReader("{\n \"subject\": \"<string>\",\n \"message\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-CSRF-Token", "<x-csrf-token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/v1/account/support/tickets")
.header("X-CSRF-Token", "<x-csrf-token>")
.header("Content-Type", "application/json")
.body("{\n \"subject\": \"<string>\",\n \"message\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/account/support/tickets")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-CSRF-Token"] = '<x-csrf-token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"subject\": \"<string>\",\n \"message\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"ticket": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"subject": "<string>",
"status": "open",
"priority": "low",
"open": true,
"canReply": true,
"unreadCount": 123,
"messageCount": 123,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"lastMessageAt": "2023-11-07T05:31:56Z",
"mergedIntoTicketId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"messages": [
{
"id": 123,
"author": "customer",
"body": "<string>",
"unread": true,
"createdAt": "2023-11-07T05:31:56Z",
"attachments": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"kind": "photo",
"fileName": "<string>",
"mediaType": "<string>",
"sizeBytes": 123,
"downloadable": true,
"createdAt": "2023-11-07T05:31:56Z",
"messageId": 123
}
]
}
]
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"request_id": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"request_id": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"request_id": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"request_id": "<string>"
}account
Post v1accountsupporttickets
Opens a conversation and answers it whole, with its first message. The number a customer may hold open at once is bounded, so a loop in a client cannot fill the operator queue faster than people can empty it, and the route is rate-limited per customer on top.
POST
/
v1
/
account
/
support
/
tickets
cURL
curl --request POST \
--url https://api.example.com/v1/account/support/tickets \
--header 'Content-Type: application/json' \
--header 'X-CSRF-Token: <x-csrf-token>' \
--data '
{
"subject": "<string>",
"message": "<string>"
}
'import requests
url = "https://api.example.com/v1/account/support/tickets"
payload = {
"subject": "<string>",
"message": "<string>"
}
headers = {
"X-CSRF-Token": "<x-csrf-token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-CSRF-Token': '<x-csrf-token>', 'Content-Type': 'application/json'},
body: JSON.stringify({subject: '<string>', message: '<string>'})
};
fetch('https://api.example.com/v1/account/support/tickets', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/v1/account/support/tickets",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'subject' => '<string>',
'message' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-CSRF-Token: <x-csrf-token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/account/support/tickets"
payload := strings.NewReader("{\n \"subject\": \"<string>\",\n \"message\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-CSRF-Token", "<x-csrf-token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/v1/account/support/tickets")
.header("X-CSRF-Token", "<x-csrf-token>")
.header("Content-Type", "application/json")
.body("{\n \"subject\": \"<string>\",\n \"message\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/account/support/tickets")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-CSRF-Token"] = '<x-csrf-token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"subject\": \"<string>\",\n \"message\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"ticket": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"subject": "<string>",
"status": "open",
"priority": "low",
"open": true,
"canReply": true,
"unreadCount": 123,
"messageCount": 123,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"lastMessageAt": "2023-11-07T05:31:56Z",
"mergedIntoTicketId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"messages": [
{
"id": 123,
"author": "customer",
"body": "<string>",
"unread": true,
"createdAt": "2023-11-07T05:31:56Z",
"attachments": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"kind": "photo",
"fileName": "<string>",
"mediaType": "<string>",
"sizeBytes": 123,
"downloadable": true,
"createdAt": "2023-11-07T05:31:56Z",
"messageId": 123
}
]
}
]
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"request_id": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"request_id": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"request_id": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"request_id": "<string>"
}Headers
Echoes the token from the current session. Required on every unsafe method.
Optional here. Supplying one makes a repeated submission resolve to the record already created instead of a second one.
Required string length:
8 - 128Body
application/json