# Announcements
WARNING
These endpoints are available only if vanguardapp/announcements (opens new window) plugin is installed.
# Paginate Announcements
GET
/announcements# Example Request
curl --location --request GET 'https://yourwebsite.com/api/announcements' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {api_key}' \
--header 'Authorization: Bearer {api_key}'# Example Response
{
"data": [
{
"id": 123,
"user_id": 22,
"title": "Hello World!",
"body": "# Welcome to this cruel world!",
"parsed_body": "<h1>Welcome to this cruel world!</h1>",
"created_at": "2020-03-20 16:47:59",
"updated_at": "2020-03-20 16:47:59"
},
// ...
],
// ...
}# Available includes
If provided, the available includes will be part of the response for each ticket object.
userA user who created the announcement.
# Sortable Fields
created_at (default), title
# Partial filters
title, body
# Exact Filters
user
# Create Announcement
POST
/announcements# Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| title | String | Yes | Announcement title. |
| body | String | Yes | Announcement text. |
| email_notifications | String | No | A flag to determine whether an email notification should be sent. Defaults to false. |
# Example Request
curl --location --request POST 'https://yourwebsite.com/api/announcements' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {api_key}' \
--header 'Authorization: Bearer {api_key}' \
--data-raw '{
"title": "Hello World!",
"body": "# Welcome to this cruel world!",
"email_notifications": true
}'# Example Response
{
"data": {
"id": 123,
"user_id": 22,
"title": "Hello World!",
"body": "# Welcome to this cruel world!",
"parsed_body": "<h1>Welcome to this cruel world!</h1>",
"created_at": "2020-03-20 16:47:59",
"updated_at": "2020-03-20 16:47:59"
}
}# Get Announcement
GET
/announcements/{id}# Example Request
curl --location --request GET 'https://yourwebsite.com/api/announcements/123' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {api_key}' \
--header 'Authorization: Bearer {api_key}'# Example Response
{
"data": {
"id": 123,
"user_id": 22,
"title": "Hello World!",
"body": "# Welcome to this cruel world!",
"parsed_body": "<h1>Welcome to this cruel world!</h1>",
"created_at": "2020-03-20 16:47:59",
"updated_at": "2020-03-20 16:47:59"
}
}# Available includes
If provided, the available includes will be part of the response for each ticket object.
userA user who created the announcement.
# Update Announcement
PATCH
/announcements/{id}# Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| title | String | No | Announcement title. |
| body | String | No | Announcement text. |
# Example Request
curl --location --request PATCH 'https://yourwebsite.com/api/announcements/123' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {api_key}' \
--header 'Authorization: Bearer {api_key}' \
--data-raw '{
"title": "Hello World!",
"body": "# Welcome to this cruel world!"
}'# Example Response
{
"data": {
"id": 123,
"user_id": 22,
"title": "Hello World!",
"body": "# Welcome to this cruel world!",
"parsed_body": "<h1>Welcome to this cruel world!</h1>",
"created_at": "2020-03-20 16:47:59",
"updated_at": "2020-03-20 16:47:59"
}
}# Delete Announcement
DELETE
/announcements/{id}# Example Request
curl --location --request DELETE 'https://yourwebsite.com/api/announcements/123' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {api_key}' \
--header 'Authorization: Bearer {api_key}'# Example Response
Status: 200 OK
{
"success": true
}