Announcement API
Prerequisites:
- Set up API access
- Verify that you have API access and obtain a token via get_token call
- The user executing the API call must be assigned the following privileges:
- 'Create Announcements'
- 'Show Announcements on Homepage'
- The user executing the API call must have edit access to the Announcements and Groups, Categories, Data Sources, Elements, Folders that are affected by the corresponding API call.
Table of contents:
1. Access Admin > System > API Toolkit
2. Configure Announcements
2.1. Get Announcements
- Item: announcement
- Methods: GET
- Select whether to return all Announcements that are available to the user ("Y") or to return only the Announcements that are displayed on the user's homepage ("N")
- Enter an API Token
- [Run request]
- The returned object contains an array of objects each of which contains Announcement's data.
- See Example Response and Fields Description for details
Example Response
{
"announcements": [
{
"id": "25",
"enabled": "Y",
"show_on_viewer": "N",
"show_on_viewer_scope": "all",
"border_color": "",
"show_on_homepage": "Y",
"show_on_portal_page": "N",
"subject": "Special Announcement",
"visible_to": "all",
"time_window": "N",
"start_time": "2023-08-09 15:40:41",
"end_time": "2023-08-10 15:40:41",
"created_by": "Robert Isaenko",
"requires_approval": "N",
"allow_to_dismiss": "Y",
"html_code": "<p>Hello! This is a <strong>special</strong> announcement</p>"
}
]
}
Fields Description
2.2. Create Announcement
- Item: announcement
- Methods: POST
- Enter any number
- Select JSON request and enter JSON providing the needed values for your Announcement:
- The value of
id
parameter is assigned automatically and does not need to be provided manually - All parameters that were not provided manually will be assigned default values
- See Example Response for details on Announcement's data structure
- The value of
- Enter an API Token
- [Run request]
- The returned object contains an array with an object with the created Announcement's data.
- See Example Response and Fields Description for details
2.3. Update Announcement
- Item: announcement
- Methods: PUT
- Enter ID of the Announcement that needs to be updated
- Select JSON request and enter JSON with the updated Announcement's data
- See Example Response for details on Announcement's data
- Enter an API Token
- [Run request]
- The returned object contains an array with an object with the updated Announcement's data.
- See Example Response and Fields Description for details
2.4. Delete Announcement
- Item: announcement
- Methods: DELETE
- Enter ID of the Announcement that needs to be deleted
- Enter an API Token
- [Run request]
2.5. Announcement Actions: Accept, Decline, Dismiss, Clear Dismiss
- Item: announcement
- Methods: PUT
- Enter ID of the Announcement that needs to be updated
- Actions: select an action that needs to be performed with an Announcement
- Enter an API Token
- [Run request]
3. Configure Announcement Groups
Note: In order to create or delete Announcement Groups you need to execute GET request first to obtain the value of the id
property of the Announcement Group's data entry.
3.1. Get Announcement Groups
- Item: announcement_group
- Methods: GET
- announcement_id: Enter ID of the Announcement
- Enter an API Token
- [Run request]
- The returned object contains an array of objects with announcement Group data:
-
id
: The identifier of the Announcement Group's data entry -
announcement_id
: The ID of the Announcement -
group_id
: The ID of the Group
-
See Example Response for details.
Example Response
{
"announcement_groups": [
{
"id": "10",
"announcement_id": "22",
"group_id": "53"
},
{
"id": "11",
"announcement_id": "22",
"group_id": "60"
}
]
}
3.2. Add Announcement Group
- Item: announcement_group
- Methods: POST
- Enter ID of the existing Announcement Group's data entry
- See Get Announcement Groups for details
- Enter JSON replacing the value of the
group_id
with a new Group's ID - Enter an API Token
- [Run request]
Delete Announcement Group
- Item: announcement_group
- Methods: DELETE
- Enter ID of the Announcement Group's data entry that needs to be deleted
- See Get Announcement Groups for details
- Enter an API Token
- [Run request]
4. Configure Announcement Categories
Note: In order to add or delete Announcement Categories you need to execute GET request first to obtain the value of the id
property of the Announcement Category's data entry.
4.1. Get Announcement Categories
- Item: announcement_category
- Methods: GET
- announcement_id: Enter ID of the Announcement
- Enter an API Token
- [Run request]
- The returned object contains an array of objects with Announcement Categories' data:
-
id
: The identifier of the Announcement Category's data entry -
announcement_id
: The ID of the Announcement -
category_id
: The ID of the Category
-
See Example Response for details.
Example Response
{
"announcement_categories": [
{
"announcement_id": "22",
"category_id": "123",
"id": "5"
},
{
"announcement_id": "22",
"category_id": "86",
"id": "6"
},
{
"announcement_id": "22",
"category_id": "25",
"id": "7"
}
]
}
4.2. Add Announcement Category
- Item: announcement_category
- Methods: POST
-
announcement_id: Enter ID of the existing Announcement Category's data entry
- See for Get Announcement Groups details
- Select JSON request and replace the value of the
category_id
with ID of the Category that needs to be added to the Announcement - Enter an API Token
- [Run request]
4.3. Delete Announcement Category
- Item: announcement_category
- Methods: DELETE
-
announcement_id: Enter ID of the Announcement Category's data entry that needs to be deleted
- See Get Announcement Groups for details
- Enter an API Token
- [Run request]
5. Configure Announcement Data Sources
Note: In order to add or delete Announcement Data Sources you need to execute GET request first to obtain the value of the id
property of the Announcement Data Source data entry.
5.1. Get Announcement Data Sources
- Item: announcement_datasource
- Methods: GET
- announcement_id: Enter ID of the Announcement
- Enter an API Token
- [Run request]
- The returned object contains an array of objects with Announcement Data Source's data:
-
announcement_id
: The ID of the Announcement -
datasource_id
: The ID of the Data Source -
id
: The identifier of the entry with Announcement Data Source's data
-
See Example Response for details.
Example Response
{
"announcement_datasources": [
{
"announcement_id": "22",
"datasource_id": "171_plugin",
"id": "4"
},
{
"announcement_id": "22",
"datasource_id": "138_sql",
"id": "8"
},
{
"announcement_id": "22",
"datasource_id": "1_sql",
"id": "11"
}
]
}
5.2. Add Announcement Data Source
- Item: announcement_datasource
- Methods: POST
-
ID: Enter ID of the existing Announcement Data Source's data entry
- See Get Announcement Data Sources for details
- Select JSON request and replace the value of the
datasource_id
depending on the Data Source type:- Plugin Data Source:
<Data Source ID>_plugin
- SQL Data Source:
<Data Source ID>_sql
- Plugin Data Source:
- Enter an API Token
- [Run request]
5.3. Delete Announcement Data Source
- Item: announcement_datasource
- Methods: DELETE
-
announcement_id: Enter ID of the Announcement Data Source's data entry that needs to be deleted
- See Get Announcement Data Sources for details
- Enter an API Token
- [Run request]
6. Configure Announcement Elements
Note: In order to add or delete Announcement Elements you need to execute GET request first to obtain the value of the id
property of the Announcement Element's data entry.
6.1. Get Announcement Elements
- Item: announcement_element
- Methods: GET
- announcement_id: Enter ID of the Announcement
- Enter an API Token
- [Run request]
- The returned object contains an array of objects with Announcement Element's data:
-
id
: The identifier of the entry with Announcement Element's data -
announcement_id
: The ID of the Announcement -
element_id
: The ID of the Element
-
See Example Response for details.
Example Response
{
"announcement_elements": [
{
"id": "10",
"announcement_id": "22",
"element_id": "1286"
},
{
"id": "9",
"announcement_id": "22",
"element_id": "1640"
},
{
"id": "8",
"announcement_id": "22",
"element_id": "122373"
}
]
}
6.2. Add Announcement Element
- Item: announcement_element
- Methods: POST
-
ID: Enter ID of the existing Announcement Element's data entry
- See Get Announcement Elements for details
- Select JSON request and replace the value of the
element_id
with the ID of the Element that needs to be added to the Announcement - Enter an API Token
- [Run request]
6.3. Delete Announcement Element
- Item: announcement_element
- Methods: DELETE
- Enter ID of the Announcement Element's data entry that needs to be deleted
- See Get Announcement Elements for details
- Enter an API Token
- [Run request]
7. Configure Announcement Folders
Note: In order to add or delete Announcement Folders you need to execute GET request first to obtain the value of the id
property of the Announcement Folder's data entry.
7.1. Get Announcement Folders
- Item: announcement_folder
- Methods: GET
- announcement_id: Enter ID of the Announcement
- Enter an API Token
- [Run request]
- The returned object contains an array of objects with Announcement Folder's data:
-
id
: The identifier of the entry with Announcement Element's data -
announcement_id
: The ID of the Announcement -
folder_id
: The ID of the Folder
-
See Example Response for details.
Example Response
{
"announcement_folders": [
{
"id": "2",
"announcement_id": "22",
"folder_id": "120"
},
{
"id": "3",
"announcement_id": "22",
"folder_id": "28"
}
]
}
7.2. Add Announcement Folder
- Item: announcement_folder
- Methods: POST
-
ID: Enter ID of the existing Announcement Folder's data entry
- See Get Announcement Folders for details
- Select JSON request and replace the value of the
folder_id
with the ID of the Folder that needs to be added to the Announcement - Enter an API Token
- [Run request]
7.3. Delete Announcement Folder
- Item: announcement_folder
- Methods: DELETE
- Enter ID of the Announcement Folder's data entry that needs to be deleted
- See Get Announcement Folders for details
- Enter an API Token
- [Run request]