Appointments
List ticket appointments (bare array)
Parameters
| Name | In | Type | Description |
|---|---|---|---|
| when | query | string (past | today | future) | |
| mine | query | integer (0 | 1) | |
| client_id | query | integer |
Example request
curl "https://YOUR-HOST/api/v1/appointments" \
-H "Authorization: Bearer $TOKEN"
import requests
response = requests.get(
"https://YOUR-HOST/api/v1/appointments",
headers={"Authorization": f"Bearer {TOKEN}"},
)
print(response.json())
const response = await fetch("https://YOUR-HOST/api/v1/appointments", {
method: "GET",
headers: { "Authorization": `Bearer ${TOKEN}` },
});
const data = await response.json();
$ch = curl_init("https://YOUR-HOST/api/v1/appointments");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => ["Authorization: Bearer $token"],
]);
$data = json_decode(curl_exec($ch), true);
Responses
200Appointments
| Field | Type | Description |
|---|---|---|
| []id | integer | |
| []ticket_id | integer | |
| []number | integer | |
| []subject | string | |
| []schedule | string | |
| []schedule_end | string | |
| []onsite | boolean | |
| []notes | string | |
| []priority | string | |
| []status | string | |
| []status_color | string | |
| []client | string | |
| []assigned_to | string |
Example response
json
[
{
"id": 1,
"ticket_id": 1,
"number": 1,
"subject": "string",
"schedule": "string",
"schedule_end": "string",
"onsite": true,
"notes": "string",
"priority": "string",
"status": "string",
"status_color": "string",
"client": "string",
"assigned_to": "string"
}
]
Create a ticket appointment (schedule entry)
Request body (application/json, required)
| Field | Type | Description |
|---|---|---|
| ticket_idrequired | integer | |
| schedule_startrequired | string | Y-m-d H:i:s |
| schedule_end | string | |
| onsite | boolean | |
| notes | string |
Example request
curl -X POST "https://YOUR-HOST/api/v1/appointments" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"ticket_id":1,"schedule_start":"string","schedule_end":"string","onsite":true,"notes":"string"}'
import requests
response = requests.post(
"https://YOUR-HOST/api/v1/appointments",
headers={"Authorization": f"Bearer {TOKEN}"},
json={
"ticket_id": 1,
"schedule_start": "string",
"schedule_end": "string",
"onsite": True,
"notes": "string"
},
)
print(response.json())
const response = await fetch("https://YOUR-HOST/api/v1/appointments", {
method: "POST",
headers: { "Authorization": `Bearer ${TOKEN}`, "Content-Type": "application/json" },
body: JSON.stringify({
"ticket_id": 1,
"schedule_start": "string",
"schedule_end": "string",
"onsite": true,
"notes": "string"
}),
});
const data = await response.json();
$ch = curl_init("https://YOUR-HOST/api/v1/appointments");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => ["Authorization: Bearer $token", "Content-Type: application/json"],
CURLOPT_POSTFIELDS => '{"ticket_id":1,"schedule_start":"string","schedule_end":"string","onsite":true,"notes":"string"}',
]);
$data = json_decode(curl_exec($ch), true);
Responses
201Appointment created
| Field | Type | Description |
|---|---|---|
| id | integer |
Example response
json
{
"id": 1
}
400Bad request
| Field | Type | Description |
|---|---|---|
| error | string |
403Authenticated but not permitted
| Field | Type | Description |
|---|---|---|
| error | string |
404Resource not found
| Field | Type | Description |
|---|---|---|
| error | string |