Add a ticket member
curl --request POST \
--url https://{domain}/api/application/tickets/{ticket}/members \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"user_id": 193,
"invited_by_user_id": 192,
"action": "pending"
}
'import requests
url = "https://{domain}/api/application/tickets/{ticket}/members"
payload = {
"user_id": 193,
"invited_by_user_id": 192,
"action": "pending"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({user_id: 193, invited_by_user_id: 192, action: 'pending'})
};
fetch('https://{domain}/api/application/tickets/{ticket}/members', 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://{domain}/api/application/tickets/{ticket}/members",
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([
'user_id' => 193,
'invited_by_user_id' => 192,
'action' => 'pending'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://{domain}/api/application/tickets/{ticket}/members"
payload := strings.NewReader("{\n \"user_id\": 193,\n \"invited_by_user_id\": 192,\n \"action\": \"pending\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <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://{domain}/api/application/tickets/{ticket}/members")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"user_id\": 193,\n \"invited_by_user_id\": 192,\n \"action\": \"pending\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{domain}/api/application/tickets/{ticket}/members")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"user_id\": 193,\n \"invited_by_user_id\": 192,\n \"action\": \"pending\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": 48,
"status": "pending",
"notification_preference": "subscribed",
"token_expires_at": null,
"user": {
"id": 193,
"name": "Liam Walker",
"email": "liam.walker@example.com",
"avatar": "/assets/default-avatar.png"
}
},
"message": "Ticket member created.",
"meta": {
"request_id": "f97c17d4-d7d2-4cfc-8844-59fd3b3c3737"
}
}Members
Add a ticket member
Adds another user to the ticket. force_add adds them straight away, send_invite emails an invitation, pending creates a request that staff approve or reject. Send an Idempotency-Key header to make retries safe: the first response is stored for 24 hours and replayed with Idempotent-Replayed: true.
Permission: tickets.members
POST
/
tickets
/
{ticket}
/
members
Add a ticket member
curl --request POST \
--url https://{domain}/api/application/tickets/{ticket}/members \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"user_id": 193,
"invited_by_user_id": 192,
"action": "pending"
}
'import requests
url = "https://{domain}/api/application/tickets/{ticket}/members"
payload = {
"user_id": 193,
"invited_by_user_id": 192,
"action": "pending"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({user_id: 193, invited_by_user_id: 192, action: 'pending'})
};
fetch('https://{domain}/api/application/tickets/{ticket}/members', 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://{domain}/api/application/tickets/{ticket}/members",
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([
'user_id' => 193,
'invited_by_user_id' => 192,
'action' => 'pending'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://{domain}/api/application/tickets/{ticket}/members"
payload := strings.NewReader("{\n \"user_id\": 193,\n \"invited_by_user_id\": 192,\n \"action\": \"pending\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <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://{domain}/api/application/tickets/{ticket}/members")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"user_id\": 193,\n \"invited_by_user_id\": 192,\n \"action\": \"pending\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{domain}/api/application/tickets/{ticket}/members")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"user_id\": 193,\n \"invited_by_user_id\": 192,\n \"action\": \"pending\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": 48,
"status": "pending",
"notification_preference": "subscribed",
"token_expires_at": null,
"user": {
"id": 193,
"name": "Liam Walker",
"email": "liam.walker@example.com",
"avatar": "/assets/default-avatar.png"
}
},
"message": "Ticket member created.",
"meta": {
"request_id": "f97c17d4-d7d2-4cfc-8844-59fd3b3c3737"
}
}Authorizations
Headers
Body
application/json
Was this page helpful?

