Ticket Announcements

7 views Markdown

The five endpoints that publish and manage the announcements shown in the support area.

Overview

Announcements are banners hung across the support area as a whole rather than on one ticket. They carry things like planned maintenance, a passing outage or news of a new service. A client sees them on reaching the support page.

Who sees one is narrowed by four targeting fields: country, language, product group and server. Leave them all out and the announcement is open to everyone; fill one in and only clients matching it see it.

When it shows comes from two dates and a switch. The dates draw the window and the switch turns the whole thing on or off, and the two work together.

Reference

Listing the Announcements

get/api/v1/admin/tickets/announcements
Tickets/GetTicketAnnouncements admin

Returns the announcements shown in the support area.

Response fields data[] — 13
idintThe announcement id.
titlestringThe announcement title.
messagestringThe announcement text.
typestringThe banner tone: info, warning, danger, success.
countrystring | nullThe country aimed at. Empty shows it to every country.
langstring | nullThe language aimed at. Empty shows it in every language.
product_groupintThe product group aimed at. Zero means every group.
server_idintThe server aimed at. Zero means every server.
start_datestring | nullWhen it starts showing.
end_datestring | nullWhen it stops showing.
is_popupboolWhether it opens as a window instead of a banner.
statusboolWhether the announcement is live.
created_atstring | nullWhen it was created.
Errors 1
insufficient_scope403The key lacks the required scope.
Request
curl 'https://panel.example.com/api/v1/admin/tickets/announcements' \
  -H "Authorization: Bearer $API_KEY"
const res  = await fetch('https://panel.example.com/api/v1/admin/tickets/announcements', {
  headers: { Authorization: `Bearer ${apiKey}` },
});
const body = await res.json();
$ch = curl_init('https://panel.example.com/api/v1/admin/tickets/announcements');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER     => ['Authorization: Bearer ' . $apiKey],
]);

$body = json_decode(curl_exec($ch), true);
curl_close($ch);
// The list is NOT filtered: past, future and switched-off announcements come back too.
$all  = Api::Tickets()->GetTicketAnnouncements()['data'];
$live = array_filter($all, fn ($a) => $a['status']);

Creating an Announcement

post/api/v1/admin/tickets/announcements
Tickets/CreateTicketAnnouncement admin goes live at once

Publishes a new announcement for clients to see.

Body 11
titlestringreqThe announcement title.
messagestringreqThe announcement text.
typestringThe banner tone: info, warning, danger, success. The info tone by default.
countrystringShows it to this country only.
langstringShows it in this language only.
product_groupintShows it to this product group only.
server_idintShows it to clients on this server only.
start_datestringWhen it starts showing.
end_datestringWhen it stops showing.
is_popupboolOpens it as a window.
statusboolPuts the announcement live. On by default.
Response fields 201 — data
dataobjectThe announcement created. Same shape as a list item.
Errors 3
title_required422The title is empty.
message_required422The message is empty.
insufficient_scope403The key lacks the required scope.
Request
curl -X POST 'https://panel.example.com/api/v1/admin/tickets/announcements' \
  -H "Authorization: Bearer $API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{"title":"Planli bakim","message":"02:00-03:00 arasi kesinti olacak.","type":"warning"}'
const res = await fetch('https://panel.example.com/api/v1/admin/tickets/announcements', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${apiKey}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    title: 'Scheduled maintenance',
    message: 'We will be down between 02:00 and 03:00.',
    type: 'warning',
    is_popup: true,
  }),
});

const body = await res.json();
$ch = curl_init('https://panel.example.com/api/v1/admin/tickets/announcements');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_POST           => true,
    CURLOPT_HTTPHEADER     => [
        'Authorization: Bearer ' . $apiKey,
        'Content-Type: application/json',
    ],
    CURLOPT_POSTFIELDS => json_encode([
        'title'    => 'Scheduled maintenance',
        'message'  => 'We will be down between 02:00 and 03:00.',
        'type'     => 'warning',
        'is_popup' => true,
    ]),
]);

$body = json_decode(curl_exec($ch), true);
curl_close($ch);
// Leave the status out and the announcement is born LIVE and shows at once; set dates first.
Api::Tickets()->CreateTicketAnnouncement([
    'title'      => 'Scheduled maintenance',
    'message'    => $text,
    'start_date' => '2026-02-01 02:00:00',
    'end_date'   => '2026-02-01 03:00:00',
]);

Reading One Announcement

get/api/v1/admin/tickets/announcements/{aid}
Tickets/GetTicketAnnouncement admin

Returns a single announcement.

Response fields data — 13
idintThe announcement id.
titlestringThe announcement title.
messagestringThe announcement text.
typestringThe banner tone: info, warning, danger, success.
countrystring | nullThe country aimed at. Empty shows it to every country.
langstring | nullThe language aimed at. Empty shows it in every language.
product_groupintThe product group aimed at. Zero means every group.
server_idintThe server aimed at. Zero means every server.
start_datestring | nullWhen it starts showing.
end_datestring | nullWhen it stops showing.
is_popupboolWhether it opens as a window instead of a banner.
statusboolWhether the announcement is live.
created_atstring | nullWhen it was created.
Errors 2
not_found404No such announcement.
insufficient_scope403The key lacks the required scope.
Request
curl 'https://panel.example.com/api/v1/admin/tickets/announcements/4' \
  -H "Authorization: Bearer $API_KEY"
const res  = await fetch(`https://panel.example.com/api/v1/admin/tickets/announcements/${aid}`, {
  headers: { Authorization: `Bearer ${apiKey}` },
});
const body = await res.json();
$ch = curl_init('https://panel.example.com/api/v1/admin/tickets/announcements/' . $aid);
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER     => ['Authorization: Bearer ' . $apiKey],
]);

$body = json_decode(curl_exec($ch), true);
curl_close($ch);
// Whether an announcement shows RIGHT NOW comes from the status and the dates together.
$a = Api::Tickets()->GetTicketAnnouncement(['aid' => $aid])['data'];

Updating an Announcement

patch/api/v1/admin/tickets/announcements/{aid}
Tickets/UpdateTicketAnnouncement admin

Changes the announcement fields you send.

Body 11
titlestringreqThe announcement title.
messagestringreqThe announcement text.
typestringThe banner tone: info, warning, danger, success. The info tone by default.
countrystringShows it to this country only.
langstringShows it in this language only.
product_groupintShows it to this product group only.
server_idintShows it to clients on this server only.
start_datestringWhen it starts showing.
end_datestringWhen it stops showing.
is_popupboolOpens it as a window.
statusboolPuts the announcement live. On by default.
Response fields data — 13
dataobjectThe announcement as it now stands. Same shape as a list item.
Errors 4
title_required422The title was emptied.
message_required422The message was emptied.
not_found404No such announcement.
insufficient_scope403The key lacks the required scope.
Request
curl -X PATCH 'https://panel.example.com/api/v1/admin/tickets/announcements/4' \
  -H "Authorization: Bearer $API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{"status":false}'
const res = await fetch(`https://panel.example.com/api/v1/admin/tickets/announcements/${aid}`, {
  method: 'PATCH',
  headers: {
    Authorization: `Bearer ${apiKey}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ status: false }),
});

const body = await res.json();
$ch = curl_init('https://panel.example.com/api/v1/admin/tickets/announcements/' . $aid);
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST  => 'PATCH',
    CURLOPT_HTTPHEADER     => [
        'Authorization: Bearer ' . $apiKey,
        'Content-Type: application/json',
    ],
    CURLOPT_POSTFIELDS => json_encode(['status' => false]),
]);

$body = json_decode(curl_exec($ch), true);
curl_close($ch);
// What you leave out is KEPT; switch the status off to silence one without removing it.
Api::Tickets()->UpdateTicketAnnouncement(['aid' => $aid, 'status' => false]);

Deleting an Announcement

delete/api/v1/admin/tickets/announcements/{aid}
Tickets/DeleteTicketAnnouncement admin

Removes an announcement.

Response fields data — 2
deletedboolWhether the delete ran.
idintThe id of the announcement removed.
Errors 2
not_found404No such announcement.
insufficient_scope403The key lacks the required scope.
Request
curl -X DELETE 'https://panel.example.com/api/v1/admin/tickets/announcements/4' \
  -H "Authorization: Bearer $API_KEY"
const res = await fetch(`https://panel.example.com/api/v1/admin/tickets/announcements/${aid}`, {
  method: 'DELETE',
  headers: { Authorization: `Bearer ${apiKey}` },
});

const body = await res.json();
$ch = curl_init('https://panel.example.com/api/v1/admin/tickets/announcements/' . $aid);
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST  => 'DELETE',
    CURLOPT_HTTPHEADER     => ['Authorization: Bearer ' . $apiKey],
]);

$body = json_decode(curl_exec($ch), true);
curl_close($ch);
// Rather than delete a past announcement, give it an END DATE: the record stays, the showing stops.
Api::Tickets()->DeleteTicketAnnouncement(['aid' => $aid]);

Pitfalls

A new announcement goes live at once

Leave the status field out and the announcement is created live. With no dates either, clients begin seeing it that moment. There is no notion of a draft here. While preparing one, either send the status off or put the start date on a later day.

The list arrives unfiltered

The listing endpoint returns every announcement, including ones that have expired, ones that have yet to start and ones switched off. It gives the set an operator manages rather than the set a client sees. To count what is live on a dashboard, weigh the status and both dates yourself.

The targeting fields narrow rather than widen

Country, language, product group and server each shrink the audience. Filling more than one means all of them at once rather than any of them. A client who fails to match all four sees nothing. When an announcement reaches nobody, look at these fields first.

The window option interrupts

An announcement that opens as a window interrupts the client and stands in front of them until closed. For news that is not truly urgent, the banner tone does the job. An old announcement left as a window turns up months later in front of someone it no longer concerns. An end date prevents that.

Date it rather than delete it

Deleting a past announcement wipes it out, leaving no record of what you said and when. Giving it an end date or switching the status off stops the showing and leaves the record in place. When the same maintenance window comes round next month, updating the dates beats writing the text again.

Was this helpful?

Thanks for your feedback!

Still Need Help?

Our support team is here around the clock for anything you can't find above.