News

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) and the optional base_id segment. Without authentication, only the public Flylogs feed is returned and full entry content is included.

Path Parameters

Parameter
Type
Description

base_id

string

Optional. Restrict to news for a specific base (or no base assigned)

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

GET /news/news/view/{slug}.json

Retrieve a single news article by its slug. Behaviour depends on the viewer:

  • Manager (user_group_id <= 135): full NewsRecipient group list and NewsRecipientUsers total user count are included. The view_count is not incremented.

  • Regular user (user_group_id > 135): only their own NewsSignature is included. view_count is incremented on each view.

  • Unauthenticated: only the public Flylogs feed is returned.

Path Parameters

Parameter
Type
Description

slug

string

Article slug

Response

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

POST /manager/news/news/edit.json

Create or update a news article. Admin access required.

Request Body

  • 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.

Response

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


Delete News

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

Delete a news article. Admin access required.

Path Parameters

Parameter
Type
Description

id

string

News article ID

Response


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

Parameter
Type
Description

id

string

News article ID

Request Body

Field
Type
Required
Description

password

string

Yes

The signing user's account password (verified against their stored credential)

Response

Errors

Status
Cause

400

Not a POST, missing/empty password, or password does not match

404

Article not found in the user's company

Last updated