Trailers
Delete trailer event
Cancel a scheduled trailer event by ID so it no longer blocks the trailer in the dispatch planner, with If-Match concurrency.
DELETE
/
api
/
p
/
v
{version}
/
trailers
/
events
/
{id}
Delete trailer event
curl --request DELETE \
--url https://integrations.alvys.com/api/p/v{version}/trailers/events/{id} \
--header 'Authorization: Bearer <token>' \
--header 'If-Match: <if-match>'const options = {
method: 'DELETE',
headers: {'If-Match': '<if-match>', Authorization: 'Bearer <token>'}
};
fetch('https://integrations.alvys.com/api/p/v{version}/trailers/events/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://integrations.alvys.com/api/p/v{version}/trailers/events/{id}"
headers = {
"If-Match": "<if-match>",
"Authorization": "Bearer <token>"
}
response = requests.delete(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://integrations.alvys.com/api/p/v{version}/trailers/events/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"If-Match: <if-match>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://integrations.alvys.com/api/p/v{version}/trailers/events/{id}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("If-Match", "<if-match>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://integrations.alvys.com/api/p/v{version}/trailers/events/{id}")
.header("If-Match", "<if-match>")
.header("Authorization", "Bearer <token>")
.asString();{
"Type": "<string>",
"Title": "<string>",
"Status": 123,
"Detail": "<string>",
"Instance": "<string>"
}{
"Type": "<string>",
"Title": "<string>",
"Status": 123,
"Detail": "<string>",
"Instance": "<string>"
}{
"Type": "<string>",
"Title": "<string>",
"Status": 123,
"Detail": "<string>",
"Instance": "<string>"
}{
"Type": "<string>",
"Title": "<string>",
"Status": 123,
"Detail": "<string>",
"Instance": "<string>"
}{
"Type": "<string>",
"Title": "<string>",
"Status": 123,
"Detail": "<string>",
"Instance": "<string>"
}{
"Type": "<string>",
"Title": "<string>",
"Status": 123,
"Detail": "<string>",
"Instance": "<string>"
}{
"Type": "<string>",
"Title": "<string>",
"Status": 123,
"Detail": "<string>",
"Instance": "<string>"
}{
"Type": "<string>",
"Title": "<string>",
"Status": 123,
"Detail": "<string>",
"Instance": "<string>"
}The Delete Trailer Event endpoint cancels a scheduled trailer event. The event stops blocking the trailer in the dispatch planner and is no longer returned by Get trailer event or Search trailer events. For more information on how versioning works and how to include it in your requests, please refer to the Versioning page.
The following header is required:
Replace
This endpoint requires the
trailer:update scope. See Authentication.If-Match is required
This endpoint uses optimistic concurrency. Send the event’s currentETag in the If-Match header. The ETag response header of Get trailer event, of Create trailer event, and of every successful update carries it. Search trailer events does not return ETags, so get the event by id first.
- If you omit
If-Match, the request is rejected with428 Precondition Required. - If the event changed after you read it, the request is rejected with
412 Precondition Failed. Get the event again and retry with the newETag.
Events created by maintenance work orders
An event created by a maintenance work order in Alvys follows that work order. It is returned by Get trailer event and Search trailer events, but it cannot be changed or deleted through the API: the request is rejected with422 Unprocessable Entity and the problem type https://api.alvys.com/errors/UnprocessableEntity/AssetEventOwnedByWorkOrder. Update the work order instead.
Request parameters
The following parameters are required in the URL path:| Parameter | Type | Required | Description |
|---|---|---|---|
| version | String | Yes | The version of the API. |
| id | String | Yes | The unique identifier of the event. |
| Header | Required | Description |
|---|---|---|
| If-Match | Yes | The current ETag of the event. |
Example cURL request
curl --location --request DELETE 'https://integrations.alvys.com/api/p/v1/trailers/events/3c9a7e10-0000-0000-0000-000000000042' \
--header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
--header 'If-Match: "00000000-0000-0000-0000-000000000001"'
YOUR_ACCESS_TOKEN with your actual Bearer token and the If-Match value with the event’s current ETag.
Response
A successful request returns204 No Content with an empty body.
Status codes
| Status | Meaning |
|---|---|
| 204 | The event was deleted. |
| 401 | The request was not authenticated. |
| 403 | The caller lacks the trailer:update scope. |
| 404 | No trailer event with this id exists, it was already deleted, or its trailer is outside the subsidiaries your credential can access. |
| 409 | The delete clashed with another change saved at the same moment. Get the event again and retry. |
| 412 | The If-Match value did not match the current event. Get the event again and retry. |
| 422 | The event was created by a maintenance work order (AssetEventOwnedByWorkOrder). |
| 428 | The If-Match header is missing. |
| 429 | The rate limit was exceeded. |
Rate limits
All endpoints are subject to rate limits to protect the API from traffic spikes. For detailed information on rate limits, please refer to the Rate Limits section. This page is interactive, allowing you to try a request by specifying the API version and the event id in the URL path. As you fill out the parameters, the cURL command on the right side of the page will be automatically updated.Authorizations
OAuth 2.0 client-credentials access token. Obtain one from https://auth.alvys.com/oauth/token (grant_type=client_credentials, audience=https://api.alvys.com/public/), then paste it here. The playground sends it as Authorization: Bearer <token>.
Headers
Response
No Content
⌘I
Delete trailer event
curl --request DELETE \
--url https://integrations.alvys.com/api/p/v{version}/trailers/events/{id} \
--header 'Authorization: Bearer <token>' \
--header 'If-Match: <if-match>'const options = {
method: 'DELETE',
headers: {'If-Match': '<if-match>', Authorization: 'Bearer <token>'}
};
fetch('https://integrations.alvys.com/api/p/v{version}/trailers/events/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://integrations.alvys.com/api/p/v{version}/trailers/events/{id}"
headers = {
"If-Match": "<if-match>",
"Authorization": "Bearer <token>"
}
response = requests.delete(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://integrations.alvys.com/api/p/v{version}/trailers/events/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"If-Match: <if-match>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://integrations.alvys.com/api/p/v{version}/trailers/events/{id}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("If-Match", "<if-match>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://integrations.alvys.com/api/p/v{version}/trailers/events/{id}")
.header("If-Match", "<if-match>")
.header("Authorization", "Bearer <token>")
.asString();{
"Type": "<string>",
"Title": "<string>",
"Status": 123,
"Detail": "<string>",
"Instance": "<string>"
}{
"Type": "<string>",
"Title": "<string>",
"Status": 123,
"Detail": "<string>",
"Instance": "<string>"
}{
"Type": "<string>",
"Title": "<string>",
"Status": 123,
"Detail": "<string>",
"Instance": "<string>"
}{
"Type": "<string>",
"Title": "<string>",
"Status": 123,
"Detail": "<string>",
"Instance": "<string>"
}{
"Type": "<string>",
"Title": "<string>",
"Status": 123,
"Detail": "<string>",
"Instance": "<string>"
}{
"Type": "<string>",
"Title": "<string>",
"Status": 123,
"Detail": "<string>",
"Instance": "<string>"
}{
"Type": "<string>",
"Title": "<string>",
"Status": 123,
"Detail": "<string>",
"Instance": "<string>"
}{
"Type": "<string>",
"Title": "<string>",
"Status": 123,
"Detail": "<string>",
"Instance": "<string>"
}