This API is used to trigger a broadcast from a predefined broadcast ID
Service URL: PUT /broadcast/{predefinedBroadcastID}
Path parameters
predefinedBroadcastID (required)
Request Headers:
Basic authentication
Content type – JSON
Request Body:
BroadcastRequest
runAt (optional) String
changesSince String
targets (optional) ITargets
topic String
locations (optional) array[String]
devices (optional) array[String]
regions (optional) array[Region]
Response Body:
IBroadcastResponse
broadcastId String
Remarks
Triggers a broadcast from predefined broadcast ID
Scenarios:
# | Scenario | Outcome | Expected Behavior | Status Code | Response |
---|
# | Scenario | Outcome | Expected Behavior | Status Code | Response |
---|---|---|---|---|---|
1 | Request with no/wrong authorization header | Fail | Does not trigger broadcast | 401 Unauthorized | Unauthorized |
2 | Request with no changes since field | Fail | Does not trigger broadcast | 400 Bad Request | Request must contain a changesSince field |
3 | Request with invalid topic | Fail | Does not trigger broadcast | 400 Bad Request | Topic must be one of (AllStores,Device,Location,Region,AllStoreServers) |
4 | Request with Invalid Predefined Broadcast Id | Fail | Does not trigger broadcast | 405 Not Found | PredefinedBroadcastdoes not exists |
5 | Request sent by a user who does not have Broadcast privileges | Fail | Does not trigger broadcast | 401 Unauthorised | Required Privileges are not granted for user. |
6 | Valid request | Success | Trigger broadcast | 200 OK | “broadcastId”: UID |
Example Request
{
"changesSince":"2021-01-02T16:01:31.000+0000",
"targets":{
"topic":"Device",
"devices" : ["pos1@0001.enactor", "pos2@0001.enactor"]
}
}
Example Response
{
"broadcastId": "d86488eb-4d28-44eb-9ebd-11101fc02ba0"
}