Using Broadcast API endpoints in the BMC Helix Digital Workplace REST API
Using the BMC Helix Digital Workplace REST API
The API follows the REST architectural style, so resources, HTTP verbs, and status codes are used. JSON is used for request and response bodies.
Transport scheme
You access the BMC Helix Digital Workplace REST API over the transport scheme that is configured for your application server, either HTTP or HTTPS. You can call API endpoints from any scripting or programming language that supports the configured transport scheme.
Base URI
The following base URI is used for calling the BMC Helix Digital Workplace server: /dwp/rest/.
Call the API endpoint from the full application host URL. If the host URL includes a port number, include the port number in your requests. Preface the URL with the correct scheme (HTTP/HTTPS).
Examples of the base URI follow:
Base URI format type | Example |
---|---|
Local machine | http://localhost:9000/dwp/rest |
HTTPS connection | https://calbroservices.com:8443/dwp/rest |
HTTP connection | http://calbroservices.com:9000/dwp/rest |
A server without a port assigned to it | http://calbroservices.com/dwp/rest |
Default header
Unless an API endpoint requires a different header, the following header is required for all requests:
X-Requested-By: <any_value>
To be able to make REST API calls, you need to log in to the application with a system-generated session token. Depending on your BMC system configuration, you might retrieve the token by using the users/login endpoint, or by obtaining a BMC Helix Single Sign-On token. A session token is valid for about 30 minutes, depending on your system configuration.
The session token must be included in all subsequent calls for the system to trust requests from the application or script that has been granted that token.
Broadcast API endpoints and actions
The following sections describe the actions you can perform using the Broadcast API endpoints.
To create and send a broadcast
You specify a list of user IDs, user email addresses, locations, groups, or services as recipients of the broadcast.
Parameters
Name | Required/Optional | Description | Type | Example | Notes |
---|---|---|---|---|---|
message | Optional | The message to be broadcast. | String | This is a test broadcast. | The maximum length is 4000 characters. This includes any HTML or other markup elements. |
targets | Required | A list of the targets for the broadcast. Specify the type of target, and then the numeric IDs of the targets of that type, as demonstrated in the Example column. Users: MYIT_BROADCAST_USER_IDS (list of user IDs) Note that a single API call can only send one type of target. | JSON object | {"MYIT_BROADCAST_USER_GROUPS": [ "45001" ]} | NA |
title | Required | The title of the broadcast. | String | Broadcast Test | The maximum length is 256 characters. |
url | Optional | The URL for the title. | String | http://www.bmc.com/ | NA |
broadcasttype | Optional | The type of broadcast. One of the following options: INFORMATION, SUCCESS, WARNING, CRITICAL | String | CRITICAL | If this parameter is not specified, the default is INFORMATION. |
startTime | Optional | The start time for the broadcast, in UNIX timestamp format. | Integer | 1606747514 | NA |
endTime | Required if timeToLive is not specified | The end time for the broadcast when a start time is specified, in UNIX timestamp format. | integer | 1606747514 | At least one of endTime or timeToLive must be specified. |
timeToLive | Required if endTime is not specified | The end time for the broadcast when it is intended to go live immediately. | String | Tue Jan 19, 2021 @ 12:16 PM +05:30 | |
isServerURL | Optional | If the url parameter is specified, set this parameter to true if the URL is a server-side address, or false if the URL is a client-side address. | Boolean | true | NA |
Response
Response | Value | Notes |
---|---|---|
HTTP code | 200 | Successful response returns an object with each broadcast. |
To retrieve all broadcasts
This endpoint provides administrators with a list of all broadcasts that match the search criteria specified in the query.
Parameters
Name | Required/Optional | Description | Type | Example | Notes |
---|---|---|---|---|---|
queryname | Required | To return information about all broadcast notifications, set this parameter to MYIT_ALL_BROADCAST_NOTIFICATIONS. To return information about only the active broadcast notifications, set this parameter to MYIT_ACTIVE_BROADCAST_NOTIFICATIONS. | String | MYIT_ALL_BROADCAST_NOTIFICATIONS | Include this parameter in the query. |
attributes | Required | This parameter consists of a list of the fields to return that include information about the broadcast notification. The following table lists the fields that can be included. | String | "attributes": { "BroadcastNotification": ["id"] } | Include this parameter in the query. BroadcastNotification must be included. |
Broadcast notification attributes
Use the attributes parameter to specify which of these attributes to include. The search returns information about these attributes for each broadcast.
Name | Description |
---|---|
id | The broadcast ID. |
title | The broadcast title. |
message | The message to be broadcast. |
url | The URL associated with the broadcast title. |
broadcastStartDate | The start date for the broadcast, in UNIX timestamp format. |
broadcastEndDate | The end date for the broadcast, in UNIX timestamp format. |
createDate | The date that the broadcast was created, in UNIX timestamp format. |
modifiedDate | The date that the broadcast was last modified, in UNIX timestamp format. |
broadcastType | The type of broadcast. 0: INFORMATION |
broadcastGroupType | The type of group that the broadcast is sent to. 0: MYIT_BROADCAST_USER_GROUPS (list of user groups) |
groupList | A list of all members of the group that the broadcast is sent to. |
isServerURL | Whether the broadcast title URL is server-side or client-side. |
status | The status of the broadcast. ACTIVE, INACTIVE, STARTING_SOON, SCHEDULED |
externalBroadcast | true if the broadcast is sent from BMC Helix ITSM. false if the broadcast is sent from BMC Helix Digital Workplace. |
Response
Response | Value | Notes |
---|---|---|
HTTP code | 200 | Returns a category list object array. |
type | application/json | Not applicable. |
To remove a broadcast
Parameters
Name | Required | Description | Type | Example | Notes |
---|---|---|---|---|---|
broadcastId | Required | The ID of the broadcast to delete. | String | 1234 | Locate this parameter in the request URL. |
Response
Response | Value | Notes |
---|---|---|
HTTP code | 204 | No content. |
To retrieve a broadcast
This endpoint retrieves information about a broadcast for an end user.
Parameters
None.
Response
Response | Value | Notes |
---|---|---|
HTTP code | 200 | Application returns the category array. |
type | application/json | Not applicable. |
- ====