Sentinel API - 2.1
This documentation outlines Sentinel API v2.1 which enables the management of users, contacts, groups, broadcasts and documents. Access to the API requires a full Sentinel system which will be available from a url provided to you by YUDU at the time of deployment.
For the purposes of this documentation the url of https://sentinel.comms.zone will be used in all examples. Of course this should be replaced by the url which is provided by YUDU.
The response examples may be truncated for simplicity - this will be indicated by the use of … .
URI
The Sentinel API is hosted on the following base URI:
https://sentinel.comms.zone/api/v2.1
Errors
When making requests to the API all responses will be returned with an HTTP status code and also depending on the request a JSON response giving an explanation. Belows details the response codes returned from the API and what they mean.
| Error Code | Meaning |
|---|---|
| 400 | BAD REQUEST – The request cannot be processed because of a client error. |
| 401 | UNAUTHORIZED – Authentication is required and has not been supplied or failed. |
| 403 | FORBIDDEN – The request was valid but you do not have the correct permissions |
| 404 | NOT FOUND – The requested endpoint or record does not exist |
| 405 | METHOD NOT ALLOWED – The request method is not allowed for the endpoint. |
| 422 | UNPROCESSABLE ENTITY – The request parameters have failed validation |
| 429 | TOO MANY ATTEMPTS – Too many requests have been made in a short time. |
| 200 | OK – Successful request |
| 201 | CREATED – The request was successful and a new record has been created |
| 204 | NO CONTENT – The request was successful, no content returned |
| 500 | INTERNAL SERVER ERROR – There was an unexpected internal error |
Terminology
The following terminology is used in this documentation:
- User - A Sentinel user who has access to the Sentinel App. Some users can be given permissions to access the Sentinel backend and also be given api access. They appear in the app directory.
Contact - A contact listed in the Sentinel backend. They do not have access to the Sentinel app and cannot access the Sentinel backend. They appear in the app directory.
Group - A named collection of assigned users, contacts and documents.
Broadcast - A Sentinel broadcast which can be sent by inapp, sms or email methods.
Document - A YUDU publisher edition. The document can be assigned to individual users, or groups. The documents once assigned will appear in the Sentinel App for a logged in user.
Recipient - A recipient is a user or contact which has been added to a broadcast to recieve a broadcast message once sent.
Directory - A directory is list of users/contacts
Rate Limiting
x-ratelimit-limit: 100
x-ratelimit-remaining: 0
retry-after: 60
x-ratelimit-reset: 1509018824
When making requests to the API all responses will include rate limit headers. These headers can indicate how many requests are remaining for a given minute.
If too many requests are made within a minute a 429 Too many requests error will be returned. The retry-after header will indicate how many seconds must be waited until a request will be accepted again. The x-ratelimit-reset header provides a Unix UTC timestamp, which is the exact time that a new rate limit kicks in.
Authentication
Accept: application/json
Authorization: Bearer YOUR-API-TOKEN-HERE
Content-Type: application/x-www-form-urlencoded
When making requests to the API it is important to include some specific values in the request header.
Ensure that the Accept header is set to application/json. This will ensure json responses are always returned.
Ensure the Authorization header is set with the value of Bearer followed by the api token.If the Authorization header is not present then the request will be rejected.
Set the Content-Type to application/x-www-form-urlencoded for any POST/PUT requests.
Obtain Token
Payload
{
"email" : "m.jackson@yudu.com",
"password" : "jHYG8ghQ£hPPu"
}
Response
{
"response": 1,
"token": "YOUR-API-TOKEN-HERE",
"push_token": "YOUR-PUBLISHER-PUSH-TOKEN-HERE",
"editions": [
207790172,
581340043
]
}
As most requests require an api token to be passed the first task would be to obtain the token for all future requests. Ensure you have a valid Sentinel user setup from the Sentinel backend.
HTTP Request
POST /api/v2.1/authentication
To obtain the api token make the request replacing the post payload data with your credentials.
App Directory
List Directory
Response
{
{
"data": {
"current_page": 1,
"data": [
{
"id": 3,
"type": "user",
"name": "Snashly",
"surname": "Spallen",
"primary_email": "snashley.spallen@gudu.com",
"position": "Survival Consultant",
"department": "Survival Management",
"location": "Clitheroe",
"primary_mobile": "+4439683983",
"primary_landline": "+44104820398",
"country": "Classified",
"office": "B1",
"reports_to": "B. Grylls",
"avatar": "",
"private": {
"secondary_email": "example@spallan.com",
"secondary_mobile": "+234198345739",
"secondary_landline": "",
"emergency_contact_number": "",
"emergency_contact_name": "Steve McSteven Stevenson",
"emergency_contact_relationship": "Sister"
}
},
{
"id": 241,
"type": "contact",
"name": "Jack",
"surname": "Bean",
"mobile": "+349867349455",
"landline": "+0348993445844",
"email": "info@bean.com",
"position": "Manager",
"company": "Beans 4 U",
"avatar": ""
}
],
"first_page_url": "https://sentinel.comms.zone/api/v2.1/app/directory?page=1",
"from": 1,
"last_page": 13,
"last_page_url": "https://sentinel.comms.zone/api/v2.1/app/directory?page=13",
"next_page_url": "https://sentinel.comms.zone/api/v2.1/app/directory?page=2",
"path": "https://sentinel.comms.zone/api/v2.1/app/directory",
"per_page": 2,
"prev_page_url": null,
"to": 2,
"total": 26
}
}
HTTP Request
GET /api/v2.1/app/directory
Returns directory of all available Sentinel users and contacts
List Directory Users
Response
{
{
"data": {
"current_page": 1,
"data": [
{
"id": 3,
"type": "user",
"name": "Snashly",
"surname": "Spallen",
"primary_email": "snashley.spallen@gudu.com",
"position": "Survival Consultant",
"department": "Survival Management",
"location": "Clitheroe",
"primary_mobile": "+4439683983",
"primary_landline": "+44104820398",
"country": "Classified",
"office": "B1",
"reports_to": "B. Grylls",
"avatar": "",
"private": {
"secondary_email": "example@spallan.com",
"secondary_mobile": "+234198345739",
"secondary_landline": "",
"emergency_contact_number": "",
"emergency_contact_name": "Steve McSteven Stevenson",
"emergency_contact_relationship": "Sister"
}
},
{
"id": 4,
"type": "user",
"name": "Steve",
"surname": "Bobbington",
"primary_email": "st.bobi@ton.com",
"position": "Sales",
"department": "Sales",
"location": "London",
"primary_mobile": "+44354564563",
"primary_landline": "+4410724563",
"country": "UK",
"office": "B4",
"reports_to": "T. Turner",
"avatar": "",
"private": {
"secondary_email": "eee@yoyo.com",
"secondary_mobile": "+2382567739",
"secondary_landline": "",
"emergency_contact_number": "",
"emergency_contact_name": "Billy Bill Billington",
"emergency_contact_relationship": "Father"
}
},
],
"first_page_url": "https://sentinel.comms.zone/api/v2.1/app/directory/users?page=1",
"from": 1,
"last_page": 13,
"last_page_url": "https://sentinel.comms.zone/api/v2.1/app/directory/users?page=13",
"next_page_url": "https://sentinel.comms.zone/api/v2.1/app/directory/users?page=2",
"path": "https://sentinel.comms.zone/api/v2.1/app/directory/users",
"per_page": 2,
"prev_page_url": null,
"to": 2,
"total": 26
}
}
HTTP Request
GET /api/v2.1/app/directory/users
Returns directory of Sentinel users only
Get Directory User
Response
{
"data": {
"id": 3,
"type": "user",
"name": "Snashly",
"surname": "Spallen",
"primary_email": "snashley.spallen@gudu.com",
"position": "Survival Consultant",
"department": "Survival Management",
"location": "Clitheroe",
"primary_mobile": "+4439683983",
"primary_landline": "+44104820398",
"country": "Classified",
"office": "B1",
"reports_to": "B. Grylls",
"avatar": "",
"private": {
"secondary_email": "example@spallan.com",
"secondary_mobile": "+234198345739",
"secondary_landline": "",
"emergency_contact_number": "",
"emergency_contact_name": "Steve McSteven Stevenson",
"emergency_contact_relationship": "Sister"
}
}
}
HTTP Request
GET /api/v2.1/app/directory/users/{id}
Returns specific directory user
List Directory Contacts
Response
{
"data": {
"current_page": 1,
"data": [
{
"id": 241,
"type": "contact",
"name": "Steven",
"surname": "Williams",
"mobile": "+45986723942",
"landline": "+39684735824",
"email": "s.williams@plumbing.com",
"position": "Plumber",
"company": "Pumbers R Us",
"avatar": ""
}
],
"first_page_url": "https://sentinel.comms.zone/api/v2.1/app/directory/contacts?page=1",
"from": 1,
"last_page": 1,
"last_page_url": "https://sentinel.comms.zone/api/v2.1/app/directory/contacts?page=1",
"next_page_url": null,
"path": "https://sentinel.comms.zone/api/v2.1/app/directory/contacts",
"per_page": 100,
"prev_page_url": null,
"to": 1,
"total": 1
}
}
HTTP Request
GET /api/v2.1/app/directory/contacts
Returns directory of Sentinel contacts only
Get Directory Contact
Response
{
"data": {
"id": 241,
"type": "contact",
"name": "Steven",
"surname": "Williams",
"mobile": "+45986723942",
"landline": "+39684735824",
"email": "s.williams@plumbing.com",
"position": "Plumber",
"company": "Pumbers R Us",
"avatar": ""
}
}
HTTP Request
GET /api/v2.1/app/directory/contacts/{id}
Returns specific directory contact
List Messages
Response
{
"data": {
"current_page": 1,
"data": [
{
"token": "1-qyRGFnGA5w1vUwULFIky",
"title": "Fire Alert",
"message": "There has been a fire! Evacuate all buildings.",
"question": "",
"response_required": 0,
"response": null,
"responded_at": null,
"responded_by": null,
"broadcast_at": "2019-12-09T10:50:01+00:00",
"archived": 0,
"broadcaster": "Admin Bill"
}
],
"first_page_url": "http://sentinel.comms.zone/api/v2.1/app/messages?page=1",
"from": 1,
"last_page": 1,
"last_page_url": "http://sentinel.comms.zone/api/v2.1/app/messages?page=1",
"next_page_url": null,
"path": "http://sentinel.comms.zone/api/v2.1/app/messages",
"per_page": 100,
"prev_page_url": null,
"to": 1,
"total": 1
}
}
HTTP Request
GET /api/v2.1/app/messages
Returns all inapp broadcast messages that have been sent to the authenticated user
List Groups
Response
{
"data": {
"current_page": 1,
"data": [
{
"id": 1,
"name": "Example Group",
"broadcast": true,
"document": true,
"conference": true,
"created": "2019-12-09T10:49:13+00:00",
"updated": "2019-12-09T10:49:13+00:00"
}
],
"first_page_url": "http://sentinel.comms.zone/api/v2.1/app/groups?page=1",
"from": 1,
"last_page": 1,
"last_page_url": "http://sentinel.comms.zone/api/v2.1/app/groups?page=1",
"next_page_url": null,
"path": "http://sentinel.comms.zone/api/v2.1/app/groups",
"per_page": 100,
"prev_page_url": null,
"to": 1,
"total": 1
}
}
HTTP Request
GET /api/v2.1/app/groups
Returns a list of all Sentinel Groups the authenticated user belongs to
List Groups Directory
Response
{
{
"data": {
"current_page": 1,
"data": [
{
"id": 3,
"type": "user",
"name": "Snashly",
"surname": "Spallen",
"primary_email": "snashley.spallen@gudu.com",
"position": "Survival Consultant",
"department": "Survival Management",
"location": "Clitheroe",
"primary_mobile": "+4439683983",
"primary_landline": "+44104820398",
"country": "Classified",
"office": "B1",
"reports_to": "B. Grylls",
"avatar": "",
"private": {
"secondary_email": "example@spallan.com",
"secondary_mobile": "+234198345739",
"secondary_landline": "",
"emergency_contact_number": "",
"emergency_contact_name": "Steve McSteven Stevenson",
"emergency_contact_relationship": "Sister"
}
},
{
"id": 241,
"type": "contact",
"name": "Jack",
"surname": "Bean",
"mobile": "+349867349455",
"landline": "+0348993445844",
"email": "info@bean.com",
"position": "Manager",
"company": "Beans 4 U",
"avatar": ""
}
],
"first_page_url": "https://sentinel.comms.zone/api/v2.1/app/directory?page=1",
"from": 1,
"last_page": 13,
"last_page_url": "https://sentinel.comms.zone/api/v2.1/app/directory?page=13",
"next_page_url": "https://sentinel.comms.zone/api/v2.1/app/directory?page=2",
"path": "https://sentinel.comms.zone/api/v2.1/app/directory",
"per_page": 2,
"prev_page_url": null,
"to": 2,
"total": 26
}
}
HTTP Request
GET /api/v2.1/app/groups/directory
Returns a directory from only the groups the authenticated user belongs to
List Prepared Broadcasts
Response
{
"data": {
"current_page": 1,
"data": [
{
"id": 2,
"title": "Terror Alert",
"primary_sms": false,
"secondary_sms": false,
"primary_email": false,
"secondary_email": false,
"inapp": true,
"message": "There is a terrorist attack - please stay inside and lock all doors.",
"sms_message": "",
"response_required": false,
"question": "",
"sent": false,
"archived": false,
"prepared": true,
"created": "2019-12-09T11:38:50+00:00",
"updated": "2019-12-09T11:38:50+00:00"
}
],
"first_page_url": "http://sentinel.comms.zone/api/v2.1/app/prepared-broadcasts?page=1",
"from": 1,
"last_page": 1,
"last_page_url": "http://sentinel.comms.zone/api/v2.1/app/prepared-broadcasts?page=1",
"next_page_url": null,
"path": "http://sentinel.comms.zone/api/v2.1/app/prepared-broadcasts",
"per_page": 15,
"prev_page_url": null,
"to": 1,
"total": 1
}
}
HTTP Request
GET /api/v2.1/app/prepared-broadcasts
Returns a list of Prepared broadcasts available to the authenticated user. (Permission to send prepared broadcasts must be given from the Sentinel Console - otherwise the request will be unauthorized)
Send Prepared Broadcast
Response
204 No Content
HTTP Request
POST /api/v2.1/app/prepared-broadcasts/{id}/send
Sends a prepared broadcast (Permission to send prepared broadcasts must be given from the Sentinel Console - otherwise the request will be unauthorized)
Users
Create user
Payload
{
"name" : "Peter",
"surname" : "Smith",
"primary_email" : "peter.smith@yudu.com",
"password" : "HYhs^&£jLOPk",
}
Response
{
"success": {
"message": "Record Created.",
"status_code": 201,
"data": {
"id": 19,
"name": "Peter",
"surname": "Smith",
"primary_email": "peter.smith@yudu.com",
"secondary_email": "",
"avatar": "",
"position": "",
"department": "",
"company": "",
"country": "",
"location": "",
"office": "",
"reports_to": "",
"primary_mobile": null,
"primary_landline": null,
"secondary_mobile": null,
"secondary_landline": null,
"emergency_contact_name": "",
"emergency_contact_number": null,
"emergency_contact_relationship": "",
"active": true,
"verified": false,
"visible_in_directory": true,
"can_see_private_fields": false,
"has_full_api_access": false,
"has_backend_access": false,
"created": "2017-10-25T22:51:17+00:00",
"updated": "2017-10-25T22:51:17+00:00"
}
}
HTTP Request
POST /api/v2.1/users
Parameters
| Field | Rule |
|---|---|
| name | max:50 |
| surname | max:50 |
| password | min:8 / max:100 |
| primary_email | Must be valid email and not already be used by another user / max:250 |
| secondary_email | Must be valid email |
| position | max:100 |
| department | max:100 |
| company | max:100 |
| country | Must be a valid country code |
| location | max:100 |
| primary_mobile_code | Numeric / Must be a valid dial code |
| primary_mobile | Numeric / Max:20 |
| primary_landline_code | Numeric / Must be a valid dial code |
| primary_landline | Numeric / Max:20 |
| secondary_mobile_code | Numeric / Must be a valid dial code |
| secondary_mobile | Numeric / Max:20 |
| secondary_landline_code | Numeric / Must be a valid dial code |
| secondary_landline | Numeric / Max:20 |
| office | max:100 |
| reports_to | max:100 |
| emergency_contact_name | max:100 |
| emergency_contact_number_code | Numeric / Must be a valid dial code |
| emergency_contact_number | Numeric / Max:20 |
| emergency_contact_relationship | max:100 |
| active | boolean 1/0 |
| verified | boolean 1/0 |
| visible_in_directory | boolean 1/0 |
| can_see_private_fields | boolean 1/0 |
| has_full_api_access | boolean 1/0 |
| has_backend_access | boolean 1/0 |
List Users
Response
{
"data": {
"current_page": 5,
"data": [
{
"id": 24,
"name": "Frey",
"surname": "Bentos",
"primary_email": "frey.bentos@yudu.com",
"secondary_email": "",
"avatar": "",
"position": "",
"department": "Tinned Pies",
"company": "YUDU",
"country": "GB",
"location": "Clitheroe",
"office": "",
"reports_to": "",
"primary_mobile": null,
"primary_landline": null,
"secondary_mobile": null,
"secondary_landline": null,
"emergency_contact_name": "",
"emergency_contact_number": null,
"emergency_contact_relationship": "",
"active": true,
"verified": true,
"visible_in_directory": true,
"can_see_private_fields": true,
"has_full_api_access": true,
"has_backend_access": true,
"can_send_prepared_broadcasts_via_api": true,
"created": "2019-06-25T13:35:01+00:00",
"updated": "2019-10-30T10:18:24+00:00"
}
],
"first_page_url": "https://sentinel.comms.zone/api/v2.1/users?page=1",
"from": 5,
"last_page": 10024,
"last_page_url": "https://sentinel.comms.zone/api/v2.1/users?page=10024",
"next_page_url": "https://sentinel.comms.zone/api/v2.1/users?page=6",
"path": "https://sentinel.comms.zone/api/v2.1/users",
"per_page": 1,
"prev_page_url": "https://sentinel.comms.zone/api/v2.1/users?page=4",
"to": 5,
"total": 10024
}
}
HTTP Request
GET /api/v2.1/users
Get user
Response
{
"id": 1,
"type": "user",
"name": "Andrew",
"surname": "Bibby",
"primary_email": "aj.bibby@yudu.com",
"position": "Developer",
"department": "Sentinel",
"location": "Clitheroe",
"primary_mobile": "+440559496864",
"primary_landline": "+445466504603",
"country": "GB",
"office": "CS 1",
"reports_to": "Charlie",
"avatar": ""
}
HTTP Request
GET /api/v2.1/users/{id}
Update user
Payload
{
"name": "Billy Bob"
}
Response
204 No Content
HTTP Request
PUT /api/v2.1/users/{id}
Delete User
Response
204 No Content
HTTP Request
DELETE /api/v2.1/users/{id}
Get User Groups
{
"data": {
"current_page": 1,
"data": [
{
"id": 1,
"name": "Emergency Group 1",
"broadcast": true,
"document": true,
"conference": false,
"created": "2019-04-01T09:13:35+00:00",
"updated": "2019-04-01T09:13:35+00:00"
},
{
"id": 5,
"name": "Management Team",
"broadcast": true,
"document": true,
"conference": true,
"created": "2019-06-27T16:43:04+00:00",
"updated": "2019-07-29T09:26:42+00:00"
}
],
"first_page_url": "https://sentinel.comms.zone/api/v2.1/users/4/groups?page=1",
"from": 1,
"last_page": 1,
"last_page_url": "https://sentinel.comms.zone/api/v2.1/users/4/groups?page=1",
"next_page_url": null,
"path": "https://sentinel.comms.zone/api/v2.1/users/4/groups",
"per_page": 100,
"prev_page_url": null,
"to": 2,
"total": 2
}
}
HTTP Request
GET /api/v2.1/users/{id}/groups
Get User Broadcasts
{
"data": {
"current_page": 1,
"data": [
{
"id": 1,
"title": "There has been a fire in the main office",
"primary_sms": true,
"secondary_sms": false,
"primary_email": false,
"secondary_email": false,
"inapp": true,
"message": "Please evacuate the building!",
"sms_message": "",
"response_required": true,
"question": "Are you outside?",
"sent": true,
"archived": false,
"prepared": false,
"created": "2019-04-01T09:18:44+00:00",
"updated": "2019-04-01T09:19:02+00:00"
}
],
"first_page_url": "https://sentinel.comms.zone/api/v2.1/users/4/broadcasts?page=1",
"from": 1,
"last_page": 1,
"last_page_url": "https://sentinel.comms.zone/api/v2.1/users/4/broadcasts?page=1",
"next_page_url": null,
"path": "https://sentinel.comms.zone/api/v2.1/users/4/broadcasts",
"per_page": 100,
"prev_page_url": null,
"to": 1,
"total": 1
}
}
HTTP Request
GET /api/v2.1/users/{id}/broadcasts
Get User Documents
{
"data": {
"current_page": 1,
"data": [
{
"id": 16,
"node": 6889738,
"name": "Security Policy",
"thumbnail": "https://publisher.yudu.com/Yudu/public/thumbnail.jpg?pageId=578851394"
}
],
"first_page_url": "https://sentinel.comms.zone/api/v2.1/users/4/documents?page=1",
"from": 1,
"last_page": 1,
"last_page_url": "https://sentinel.comms.zone/api/v2.1/users/4/documents?page=1",
"next_page_url": null,
"path": "https://sentinel.comms.zone/api/v2.1/users/4/documents",
"per_page": 100,
"prev_page_url": null,
"to": 1,
"total": 1
}
}
HTTP Request
GET /api/v2.1/users/{id}/documents
Assign Document
Response
204 No Content
HTTP Request
POST /api/v2.1/users/{id}/documents/{document}
Unassign Document
Response
204 No Content
HTTP Request
DELETE /api/v2.1/users/{id}/documents/{document}
Contacts
Create contact
Payload
{
"name" : "Billy",
"surname" : "Smith",
"primary_mobile_code" : "44",
"primary_mobile" : "34659378448",
"primary_email" : "billy.smith@example.com",
}
Response
{
"success": {
"message": "Record Created.",
"status_code": 201,
"data": {
"id": 5011,
"name": "Billy",
"surname": "Smith",
"mobile": "+4434659378448",
"landline": null,
"email": "billy.smith@example.com",
"position": "",
"company": "",
"location": "",
"active": true,
"visible_in_directory": true,
"avatar": "",
"created": "2019-11-05T19:46:58+00:00",
"updated": "2019-11-05T19:46:58+00:00"
}
}
}
HTTP Request
POST /api/v2.1/contacts
Parameters
| Field | Rule |
|---|---|
| name | max:50 |
| surname | max:50 |
| mobile_code | Numeric / Must be a valid dial code |
| mobile | Numeric / Max:20 |
| landline_code | Numeric / Must be a valid dial code |
| landline | Numeric / Max:20 |
| Must be valid email and not already be used by another user / max:250 | |
| position | max:100 |
| company | max:100 |
| country | Must be a valid country code |
| location | max:100 |
| notes | max:500 |
| active | boolean 1/0 |
| visible_in_directory | boolean 1/0 |
List contacts
Response
{
"data": {
"current_page": 1,
"data": [
{
"id": 2,
"name": "Margot",
"surname": "Daniel",
"mobile": "+44425672457254",
"landline": "+448256825682",
"email": "eleanore87@example.net",
"position": " Safety Officer",
"company": "Acme",
"location": "Upper Highburn",
"active": true,
"visible_in_directory": true,
"avatar": "",
"created": "2019-06-26T14:53:25+00:00",
"updated": "2019-06-26T14:53:25+00:00"
},
{
"id": 3,
"name": "William",
"surname": "Lind",
"mobile": "+44425672457254",
"landline": "+448256825682",
"email": "kautzer.mia@example.com",
"position": "Consultant",
"company": "Digital",
"location": "Royton",
"active": true,
"visible_in_directory": true,
"avatar": "",
"created": "2019-06-26T14:53:25+00:00",
"updated": "2019-06-26T14:53:25+00:00"
}
],
"first_page_url": "https://sentinel.comms.zone/api/v2.1/contacts?page=1",
"from": 1,
"last_page": 2505,
"last_page_url": "https://sentinel.comms.zone/api/v2.1/contacts?page=2505",
"next_page_url": "https://sentinel.comms.zone/api/v2.1/contacts?page=2",
"path": "https://sentinel.comms.zone/api/v2.1/contacts",
"per_page": 2,
"prev_page_url": null,
"to": 2,
"total": 5009
}
}
HTTP Request
GET /api/v2.1/contacts
Get contact
Response
{
"data": {
"id": 2,
"name": "Margot",
"surname": "Daniel",
"mobile": "+44425672457254",
"landline": "+448256825682",
"email": "eleanore87@example.net",
"position": " Safety Officer",
"company": "Acme",
"location": "Upper Highburn",
"active": true,
"visible_in_directory": true,
"avatar": "",
"created": "2019-06-26T14:53:25+00:00",
"updated": "2019-06-26T14:53:25+00:00"
}
}
HTTP Request
GET /api/v2.1/contacts/{id}
Update contact
Payload
{
"position" : "Danger Officer"
}
Response
204 No Content
HTTP Request
PUT /api/v2.1/contacts/{id}
Delete contact
Response
204 No Content
HTTP Request
DELETE /api/v2.1/contacts/{id}
Groups
Create group
Payload
{
"name" : "Group 1",
"broadcast" : 1,
"document" : 1,
}
Response
{
"success": {
"message": "Record Created.",
"status_code": 201,
"data": {
"id": 6,
"name": "Group 1",
"broadcast": true,
"document": true,
"created": "2017-10-26T08:51:58+00:00",
"updated": "2017-10-26T08:51:58+00:00"
}
}
}
HTTP Request
POST /api/v2.1/groups
Parameters
| Field | Rule |
|---|---|
| name | Must be a unique group name |
| broadcast | boolean 1/0 |
| document | boolean 1/0 |
List groups
Response
{
"data": {
"current_page": 1,
"data": [
{
"id": 1,
"name": "Group 1",
"broadcast": true,
"document": true,
"conference": false,
"created": "2019-04-01T09:13:35+00:00",
"updated": "2019-04-01T09:13:35+00:00"
},
{
"id": 2,
"name": "Management Team",
"broadcast": false,
"document": true,
"conference": false,
"created": "2019-04-02T15:51:33+00:00",
"updated": "2019-04-02T15:51:33+00:00"
}
],
"first_page_url": "https://sentinel.comms.zone/api/v2.1/groups?page=1",
"from": 1,
"last_page": 5,
"last_page_url": "https://sentinel.comms.zone/api/v2.1/groups?page=5",
"next_page_url": "https://sentinel.comms.zone/api/v2.1/groups?page=2",
"path": "https://sentinel.comms.zone/api/v2.1/groups",
"per_page": 2,
"prev_page_url": null,
"to": 2,
"total": 10
}
}
HTTP Request
GET /api/v2.1/groups
Get group
Response
{
"id": 1,
"name": "Group 1",
"broadcast": true,
"document": true,
"conference": false,
"created": "2019-04-01T09:13:35+00:00",
"updated": "2019-04-01T09:13:35+00:00"
}
HTTP Request
GET /api/v2.1/groups/{id}
Update group
Payload
{
"name" : "Updated Group",
"broadcast" : 1,
"document" : 0,
}
Response
204 No Content
HTTP Request
PUT /api/v2.1/groups/{id}
Delete group
Response
204 No Content
HTTP Request
DELETE /api/v2.1/groups/{id}
List group users
Response
{
"data": {
"current_page": 1,
"data": [
{
"id": 4,
"name": "Barry",
"surname": "Barker",
"primary_email": "badboy@wrongbranch.com",
"secondary_email": "",
"avatar": "",
"position": "",
"department": "",
"company": "",
"country": "",
"location": "",
"office": "",
"reports_to": "",
"primary_mobile": null,
"primary_landline": null,
"secondary_mobile": null,
"secondary_landline": null,
"emergency_contact_name": "",
"emergency_contact_number": null,
"emergency_contact_relationship": "",
"active": true,
"verified": true,
"visible_in_directory": true,
"can_see_private_fields": true,
"has_full_api_access": false,
"has_backend_access": true,
"can_send_prepared_broadcasts_via_api": true,
"created": "2019-04-01T09:09:39+00:00",
"updated": "2019-07-05T10:43:13+00:00"
},
{
"id": 10031,
"name": "Steve",
"surname": "Stevenson",
"primary_email": "steve.s@yudu.com",
"secondary_email": "",
"avatar": "",
"position": "",
"department": "",
"company": "",
"country": "",
"location": "",
"office": "",
"reports_to": "",
"primary_mobile": null,
"primary_landline": null,
"secondary_mobile": null,
"secondary_landline": null,
"emergency_contact_name": "",
"emergency_contact_number": null,
"emergency_contact_relationship": "",
"active": true,
"verified": false,
"visible_in_directory": true,
"can_see_private_fields": true,
"has_full_api_access": false,
"has_backend_access": true,
"can_send_prepared_broadcasts_via_api": true,
"created": "2019-10-11T12:38:24+00:00",
"updated": "2019-10-11T12:38:24+00:00"
}
],
"first_page_url": "https://sentinel.comms.zone/api/v2.1/groups/1/users?page=1",
"from": 1,
"last_page": 11,
"last_page_url": "https://sentinel.comms.zone/api/v2.1/groups/1/users?page=11",
"next_page_url": "https://sentinel.comms.zone/api/v2.1/groups/1/users?page=2",
"path": "https://sentinel.comms.zone/api/v2.1/groups/1/users",
"per_page": 2,
"prev_page_url": null,
"to": 2,
"total": 22
}
}
HTTP Request
GET /api/v2.1/groups/{id}/users
List group contacts
Response
{
"data": {
"current_page": 1,
"data": [
{
"id": 101,
"name": "1.15 test user",
"surname": "Bloggs",
"mobile": null,
"landline": null,
"email": "test@bloggs.com",
"position": "",
"company": "",
"location": "",
"active": true,
"visible_in_directory": true,
"avatar": "",
"created": "2019-07-04T15:33:25+00:00",
"updated": "2019-07-04T15:33:25+00:00"
}
],
"first_page_url": "https://sentinel.comms.zone/api/v2.1/groups/5/contacts?page=1",
"from": 1,
"last_page": 1,
"last_page_url": "https://sentinel.comms.zone/api/v2.1/groups/5/contacts?page=1",
"next_page_url": null,
"path": "https://sentinel.comms.zone/api/v2.1/groups/5/contacts",
"per_page": 2,
"prev_page_url": null,
"to": 1,
"total": 1
}
}
HTTP Request
GET /api/v2.1/groups/{id}/contacts
List group documents
Response
{
"data": {
"current_page": 1,
"data": [
{
"id": 13,
"node": 4564577,
"name": "Security Information",
"thumbnail": "https://publisher.yudu.com/Yudu/public/thumbnail.jpg?pageId=57434572"
},
{
"id": 3,
"node": 245547,
"name": "First Aid",
"thumbnail": "https://publisher.yudu.com/Yudu/public/thumbnail.jpg?pageId=5557975675"
}
],
"first_page_url": "https://sentinel.comms.zone/api/v2.1/groups/6/documents?page=1",
"from": 1,
"last_page": 1,
"last_page_url": "https://sentinel.comms.zone/api/v2.1/groups/6/documents?page=1",
"next_page_url": null,
"path": "https://sentinel.comms.zone/api/v2.1/groups/6/documents",
"per_page": 2,
"prev_page_url": null,
"to": 2,
"total": 2
}
}
HTTP Request
GET /api/v2.1/groups/{id}/documents
Assign user
Response
204 No Content
HTTP Request
POST /api/v2.1/groups/{id}/users/{user}
Unassign user
Response
204 No Content
HTTP Request
DELETE /api/v2.1/groups/{id}/users/{user}
Assign contact
Response
204 No Content
HTTP Request
POST /api/v2.1/groups/{id}/contacts/{contact}
Unassign contact
Response
204 No Content
HTTP Request
DELETE /api/v2.0/groups/{id}/contacts/{contact}
Assign document
Response
204 No Content
HTTP Request
POST /api/v2.1/groups/{id}/documents/{user}
Unassign document
Response
204 No Content
HTTP Request
DELETE /api/v2.1/groups/{id}/documents/{user}
Documents
Response
{
"data": {
"current_page": 1,
"data": [
{
"id": 1,
"node": 6795595,
"name": "First Aid",
"thumbnail": "https://publisher.yudu.com/Yudu/public/thumbnail.jpg?pageId=5434249"
},
{
"id": 2,
"node": 6851263,
"name": "Emergency Evacuation Plan",
"thumbnail": "https://publisher.yudu.com/Yudu/public/thumbnail.jpg?pageId=55482434"
}
],
"first_page_url": "https://sentinel.comms.zone/api/v2.1/documents?page=1",
"from": 1,
"last_page": 8,
"last_page_url": "https://sentinel.comms.zone/api/v2.1/documents?page=8",
"next_page_url": "https://sentinel.comms.zone/api/v2.1/documents?page=2",
"path": "https://sentinel.comms.zone/api/v2.1/documents",
"per_page": 2,
"prev_page_url": null,
"to": 2,
"total": 16
}
}
HTTP Request
GET /api/v2.1/documents
Broadcasts
Create broadcast
Payload
{
"title" : "Fire Alert",
"message" : "A fire has broken out in the kitchens of building A",
"sms_message" : "A fire has broken out in the kitchens of building A",
"primary_sms" : 1,
"secondary_sms" : 1,
"primary_email" : 1,
"secondary_email" : 1,
"inapp" : 1,
"response_required" : 1,
"question" : "Are you safe?",
}
Response
{
"success": {
"message": "Record Created.",
"status_code": 201,
"data": {
"id": 28,
"title": "Fire Alert",
"primary_sms": true,
"secondary_sms": true,
"primary_email": true,
"secondary_email": true,
"inapp": true,
"message": "A fire has broken out in the kitchens of building A",
"sms_message": "A fire has broken out in the kitchens of building A",
"response_required": true,
"question": "Are you safe?",
"sent": false,
"archived": false,
"created": "2017-10-26T10:55:40+00:00",
"updated": "2017-10-26T10:55:40+00:00"
}
}
}
HTTP Request
POST /api/v2.1/broadcasts
Parameters
| Field | Rule |
|---|---|
| title | min:2 / max:100 |
| sms | boolean 1/0 |
| inapp | boolean 1/0 |
| boolean 1/0 | |
| message | min:5 / max:1000 |
| sms_message | min:5 / max:160 |
| groups | Array of valid group ID’s. Use ‘all_users’ or ‘all_contacts’ to add all users/contacts to the broadcast. |
| response_required | boolean 1/0 |
| question | max:160 |
List broadcasts
Response
{
"data": {
"current_page": 1,
"data": [
{
"id": 1,
"title": "Terrorism Alert",
"primary_sms": true,
"secondary_sms": false,
"primary_email": false,
"secondary_email": false,
"inapp": true,
"message": "Terrorism Alert - please lock all building doors and stay inside.",
"sms_message": "",
"response_required": true,
"question": "Are you safe?",
"sent": true,
"archived": false,
"prepared": false,
"created": "2019-04-01T09:18:44+00:00",
"updated": "2019-04-01T09:19:02+00:00"
},
{
"id": 2,
"title": "IT system failure",
"primary_sms": true,
"secondary_sms": false,
"primary_email": false,
"secondary_email": false,
"inapp": true,
"message": "All IT systems have failed - please work from home",
"sms_message": "",
"response_required": true,
"question": "Are you able to work from home?",
"sent": true,
"archived": false,
"prepared": false,
"created": "2019-04-01T09:19:29+00:00",
"updated": "2019-04-01T09:19:45+00:00"
}
],
"first_page_url": "https://sentinel.comms.zone/api/v2.1/broadcasts?page=1",
"from": 1,
"last_page": 28,
"last_page_url": "https://sentinel.comms.zone/api/v2.1/broadcasts?page=28",
"next_page_url": "https://sentinel.comms.zone/api/v2.1/broadcasts?page=2",
"path": "https://sentinel.comms.zone/api/v2.1/broadcasts",
"per_page": 2,
"prev_page_url": null,
"to": 2,
"total": 56
}
}
HTTP Request
GET /api/v2.1/broadcasts
Get broadcast
Response
{
"data": {
"id": 1,
"title": "Terrorism Alert",
"primary_sms": true,
"secondary_sms": false,
"primary_email": false,
"secondary_email": false,
"inapp": true,
"message": "Terrorism Alert - please lock all building doors and stay inside.",
"sms_message": "",
"response_required": true,
"question": "Are you safe?",
"sent": true,
"archived": false,
"prepared": false,
"created": "2019-04-01T09:18:44+00:00",
"updated": "2019-04-01T09:19:02+00:00"
}
}
HTTP Request
GET /api/v2.1/broadcasts/{id}
Get broadcast recipients
Response
{
"data": {
"current_page": 50,
"data": [
{
"id": 126,
"broadcast_id": 52,
"type": "App\\User",
"name": "Pearlie",
"surname": "Mitchell",
"primary_email": "tod.howe@example.org",
"secondary_email": "",
"primary_mobile": "+44746453876",
"secondary_mobile": "+44546262111",
"primary_sms_status": "Not Sent",
"secondary_sms_status": "Not Sent",
"primary_email_status": "Not Sent",
"secondary_email_status": "Not Sent",
"inapp_status": "Not Sent",
"response_status": 0,
"response": null,
"token": "52-FcB57qeBnFPtG64qcZkw"
},
{
"id": 127,
"broadcast_id": 52,
"type": "App\\User",
"name": "Kamron",
"surname": "Howell",
"primary_email": "ehomenick@example.com",
"secondary_email": "",
"primary_mobile": "+4474698956",
"secondary_mobile": "+44546353946",
"primary_sms_status": "Not Sent",
"secondary_sms_status": "Not Sent",
"primary_email_status": "Not Sent",
"secondary_email_status": "Not Sent",
"inapp_status": "Not Sent",
"response_status": 0,
"response": null,
"token": "52-8E6oNx4gyGdGekoSR0Vg"
}
],
"first_page_url": "https://sentinel.comms.zone/api/v2.1/recipients?page=1",
"from": 99,
"last_page": 7550,
"last_page_url": "https://sentinel.comms.zone/api/v2.1/recipients?page=7550",
"next_page_url": "https://sentinel.comms.zone/api/v2.1/recipients?page=51",
"path": "https://sentinel.comms.zone/api/v2.1/recipients",
"per_page": 2,
"prev_page_url": "https://sentinel.comms.zone/api/v2.1/recipients?page=49",
"to": 100,
"total": 15100
}
}
HTTP Request
GET /api/v2.1/broadcasts/{id}/recipients
Send Broadcast
Response
204 No Content
HTTP Request
POST /api/v2.1/broadcasts/{id}/send
Archive Broadcast
Response
204 No Content
HTTP Request
POST /api/v2.1/broadcasts/{id}/archive
Unarchive Broadcast
Response
204 No Content
HTTP Request
POST /api/v2.1/broadcasts/{id}/unarchive
Recipients
List Recipients
Response
{
"data": {
"current_page": 50,
"data": [
{
"id": 126,
"broadcast_id": 52,
"type": "App\\User",
"name": "Pearlie",
"surname": "Mitchell",
"primary_email": "tod.howe@example.org",
"secondary_email": "",
"primary_mobile": "+44746453876",
"secondary_mobile": "+44546262111",
"primary_sms_status": "Not Sent",
"secondary_sms_status": "Not Sent",
"primary_email_status": "Not Sent",
"secondary_email_status": "Not Sent",
"inapp_status": "Not Sent",
"response_status": 0,
"response": null,
"token": "52-FcB57qeBnFPtG64qcZkw"
},
{
"id": 127,
"broadcast_id": 52,
"type": "App\\User",
"name": "Kamron",
"surname": "Howell",
"primary_email": "ehomenick@example.com",
"secondary_email": "",
"primary_mobile": "+4474698956",
"secondary_mobile": "+44546353946",
"primary_sms_status": "Not Sent",
"secondary_sms_status": "Not Sent",
"primary_email_status": "Not Sent",
"secondary_email_status": "Not Sent",
"inapp_status": "Not Sent",
"response_status": 0,
"response": null,
"token": "52-8E6oNx4gyGdGekoSR0Vg"
}
],
"first_page_url": "https://sentinel.comms.zone/api/v2.1/recipients?page=1",
"from": 99,
"last_page": 7550,
"last_page_url": "https://sentinel.comms.zone/api/v2.1/recipients?page=7550",
"next_page_url": "https://sentinel.comms.zone/api/v2.1/recipients?page=51",
"path": "https://sentinel.comms.zone/api/v2.1/recipients",
"per_page": 2,
"prev_page_url": "https://sentinel.comms.zone/api/v2.1/recipients?page=49",
"to": 100,
"total": 15100
}
}
HTTP Request
GET /api/v2.1/recipients
Get Recipient
Response
{
"data": {
"id": 126,
"broadcast_id": 52,
"type": "App\\User",
"name": "Pearlie",
"surname": "Mitchell",
"primary_email": "tod.howe@example.org",
"secondary_email": "",
"primary_mobile": "+4474698973876",
"secondary_mobile": "+445466567946",
"primary_sms_status": "Not Sent",
"secondary_sms_status": "Not Sent",
"primary_email_status": "Not Sent",
"secondary_email_status": "Not Sent",
"inapp_status": "Not Sent",
"response_status": 0,
"response": null,
"token": "52-FcB57qeBnFPtG64qcZkw"
}
}
HTTP Request
GET /api/v2.1/recipients/{id}
Statistics
Response
{
"data": {
"users": 10024,
"contacts": 5009,
"groups": 10,
"sent_broadcasts": 38,
"unsent_broadcasts": 18,
"non_responders": 31
}
}
HTTP Request
GET /api/v2.1/statistics
Usage
Response
{
"data": {
"current_page": 1,
"data": [
{
"period": "2019-11-05T00:00:00+00:00",
"users": 10024,
"contacts": 5009,
"broadcasts": 0,
"inapp": 0,
"email": 0,
"sms": 0
},
{
"period": "2019-11-04T00:00:00+00:00",
"users": 10023,
"contacts": 5008,
"broadcasts": 0,
"inapp": 0,
"email": 0,
"sms": 0
}
],
"first_page_url": "https://sentinel.comms.zone/api/v2.1/usage?page=1",
"from": 1,
"last_page": 16,
"last_page_url": "https://sentinel.comms.zone/api/v2.1/usage?page=16",
"next_page_url": "https://sentinel.comms.zone/api/v2.1/usage?page=2",
"path": "https://sentinel.comms.zone/api/v2.1/usage",
"per_page": 2,
"prev_page_url": null,
"to": 2,
"total": 31
}
}
HTTP Request
GET /api/v2.1/usage
Activity
Response
{
"data": {
"current_page": 600,
"data": [
{
"id": 18202,
"created_by": "System",
"name": "sent_verification",
"message": "Sent verification SMS to Charlie Stephenson",
"created_at": "2019-10-11T17:39:39+00:00"
},
{
"id": 18201,
"created_by": "Charlie Stephenson",
"name": "created_verification",
"message": "Created verification for Charlie Stephenson",
"created_at": "2019-10-11T17:39:38+00:00"
}
],
"first_page_url": "https://sentinel.comms.zone/api/v2.1/activity?page=1",
"from": 1199,
"last_page": 1470,
"last_page_url": "https://sentinel.comms.zone/api/v2.1/activity?page=1470",
"next_page_url": "https://sentinel.comms.zone/api/v2.1/activity?page=601",
"path": "https://sentinel.comms.zone/api/v2.1/activity",
"per_page": 2,
"prev_page_url": "https://sentinel.comms.zone/api/v2.1/activity?page=599",
"to": 1200,
"total": 2940
}
}
HTTP Request
GET /api/v2.1/usage
Verification
Response
204 No Content
HTTP Request
POST /api/v2.1/verification/{id}
Pagination
{
"from": 16,
"last_page": 3,
"next_page_url": "https://sentinel.comms.zone/api/v2.1/users?page=3",
"path": "https://sentinel.comms.zone/api/v2.1/users",
"per_page": 15,
"prev_page_url": "https://sentinel.comms.zone/api/v2.1/users?page=1",
"to": 30,
"total": 37
}
Data returned is paginated when there is more than 1 record returned. So for example if all users are requested the return JSON is split into manageable chunks. After the data at the end of the response there will be some metadata which gives information about the results. This is particularly useful as it can be used to access the next or previous pages of information.
By default per_page value is 100. Which means for every request that is paginated 100 records will be returned. This value can be changed to whatever is required. Simply pass a per_page query string parameter along with the request specifying how many records should be returned per page. The minimum is 1 and the maximum is 1000. Any values outside of this range will return the default 100 records.
A specific page can be requested by passing a ‘page’ query string parameter in the request url.
CORS
The Sentinel API supports CORS or Cross Origin Resource Sharing. Without CORS it would not be possible to retrieve information for example in an app or a website on a different domain from the Sentinel API. The Sentinel API supports CORS requests from any domain.
Dates
All dates returned in any responses are in Coordinated Universal Time (UTC) and shown in ISO 8601 format.
Tools
When using the API you may find it useful to test using Postman. Postman is some useful software which will assist you in making the requests detailed in this documentation. It can be downloaded from https://www.getpostman.com/. All raw requests and responses can be seen through the Postman console and will speed up your development time and can be useful if support is required.
Support
If you require any assistance with this documentation please contact support at support@yudu.com