Skip to content

News

Role names and user_group_id values are listed in User groups.

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.

Parameter Type Description
base_id string Optional. Restrict to news for a specific base (or no base assigned)
{
"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

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): full NewsRecipient group list and NewsRecipientUsers total user count are included. The view_count is not incremented.
  • Regular user (user_group_id > 135 — Crew Scheduling and below): only their own NewsSignature is included. view_count is incremented on each view.
  • Unauthenticated: only the public Flylogs feed is returned.
Parameter Type Description
slug string Article slug
{
"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.


POST /manager/news/news/edit.json

Create or update a news article. Admin access required.

{
"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.id to create a new article.
  • notification is normalised: any value other than '0' / 'false' / empty becomes '1'. Empty/falsy values are stripped from the payload.
  • News.time, when present, is appended to News.created.
  • NewsRecipient.user_group_id[] replaces the recipient set on every save; existing recipients are deleted first.
  • company_id and user_id are forced to the authenticated user’s session.
{
"result": true,
"message": "News article saved",
"errors": []
}

On validation failure: result = false, errors contains the model validation errors.


POST /manager/news/news/delete/{id}.json

Delete a news article. Admin access required.

Parameter Type Description
id string News article ID
{
"result": true,
"message": "News deleted"
}

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.

Parameter Type Description
id string News article ID
Field Type Required Description
password string Yes The signing user’s account password (verified against their stored credential)
{
"result": true
}
Status Cause
400 Not a POST, missing/empty password, or password does not match
404 Article not found in the user’s company