News
Role names and
user_group_idvalues are listed in User groups.
List News
Section titled “List News”GET /news.json
GET /news/news/index/{base_id}.json
Retrieve company news articles. Paginated (10 per page).
When the request is authenticated, results are scoped to the user’s company and filtered by recipient user_group_id (for users with user_group_id > 105 — Compliance & Safety Manager and below) and the optional base_id segment. Without authentication, only the public Flylogs feed is returned and full entry content is included.
Path Parameters
Section titled “Path Parameters”| Parameter | Type | Description |
|---|---|---|
| base_id | string | Optional. Restrict to news for a specific base (or no base assigned) |
Response
Section titled “Response”{ "news": [ { "News": { "id": "50", "slug": "winter-operations-update", "name": "Winter Operations Update", "category": "Operations", "view_count": "42", "sign": true, "created": "2025-03-01 10:00:00" }, "NewsSignature": [ { "id": "9", "user_id": "100", "news_id": "50" } ] } ], "pagination": { "page": 1, "current": 1, "count": 23, "prevPage": false, "nextPage": true, "pageCount": 3, "limit": 10 }}| Field | Type | Description |
|---|---|---|
| slug | string | URL-friendly identifier |
| sign | boolean | Whether read-acknowledgment is required |
| NewsSignature | array | Signature record from the authenticated user (empty if not signed) |
| pagination | object | Standard CakePHP pagination block |
View News Article
Section titled “View News Article”GET /news/news/view/{slug}.json
Retrieve a single news article by its slug. Behaviour depends on the viewer:
- Manager (
user_group_id <= 135— Trainings Manager and above): fullNewsRecipientgroup list andNewsRecipientUserstotal user count are included. Theview_countis not incremented. - Regular user (
user_group_id > 135— Crew Scheduling and below): only their ownNewsSignatureis included.view_countis incremented on each view. - Unauthenticated: only the public Flylogs feed is returned.
Path Parameters
Section titled “Path Parameters”| Parameter | Type | Description |
|---|---|---|
| slug | string | Article slug |
Response
Section titled “Response”{ "post": { "News": { "id": "50", "company_id": "42", "user_id": "100", "base_id": "0", "slug": "winter-operations-update", "category": "Operations", "view_count": "43", "sign": true, "notification": "1", "name": "Winter Operations Update", "entry": "<p>Important information about winter ops procedures...</p>", "created": "2025-03-01 10:00:00", "modified": "2025-03-01 10:00:00" }, "NewsSignature": { "100": "John Doe", "101": "Jane Smith" }, "NewsRecipient": ["110", "120"], "NewsRecipientUsers": 42 }}NewsSignature is keyed by user_id → user fullname. NewsRecipient and NewsRecipientUsers are only present for managers.
Returns 404 if the slug is unknown or the article does not belong to the viewer’s company.
Create / Edit News
Section titled “Create / Edit News”POST /manager/news/news/edit.json
Create or update a news article. Admin access required.
Request Body
Section titled “Request Body”{ "News": { "id": "50", "name": "Winter Operations Update", "entry": "<p>Updated content...</p>", "category": "Operations", "sign": true, "notification": "1", "base_id": "0", "created": "2025-03-01", "time": " 10:00:00" }, "NewsRecipient": { "user_group_id": ["110", "120"] }}- Omit
News.idto create a new article. notificationis normalised: any value other than'0'/'false'/ empty becomes'1'. Empty/falsy values are stripped from the payload.News.time, when present, is appended toNews.created.NewsRecipient.user_group_id[]replaces the recipient set on every save; existing recipients are deleted first.company_idanduser_idare forced to the authenticated user’s session.
Response
Section titled “Response”{ "result": true, "message": "News article saved", "errors": []}On validation failure: result = false, errors contains the model validation errors.
Delete News
Section titled “Delete News”POST /manager/news/news/delete/{id}.json
Delete a news article. Admin access required.
Path Parameters
Section titled “Path Parameters”| Parameter | Type | Description |
|---|---|---|
| id | string | News article ID |
Response
Section titled “Response”{ "result": true, "message": "News deleted"}Sign News Article
Section titled “Sign News Article”POST /news/news/sign/{id}.json
Acknowledge a news article that has sign = true. Re-authenticates the user with their password before saving the signature.
Path Parameters
Section titled “Path Parameters”| Parameter | Type | Description |
|---|---|---|
| id | string | News article ID |
Request Body
Section titled “Request Body”| Field | Type | Required | Description |
|---|---|---|---|
| password | string | Yes | The signing user’s account password (verified against their stored credential) |
Response
Section titled “Response”{ "result": true}Errors
Section titled “Errors”| Status | Cause |
|---|---|
| 400 | Not a POST, missing/empty password, or password does not match |
| 404 | Article not found in the user’s company |