# Breaking News API ## Available Fields | Field | Type | Description | |---|---|---| | `id` | int | Breaking news item ID | | `user_id` | int | ID of the user who published the item | | `title` | string | Short headline shown in the breaking news ticker | | `content` | string | Additional details or body text | | `status` | int | `1` = active (shown in ticker), `0` = inactive (hidden) | | `created_at` | datetime | Creation date | --- ## Get All Breaking News ```json { "resource": "breaking", "action": "get", "filters": { "user_id": 1, "status": 1, "date_from": "2025-01-01", "date_to": "2025-12-31" }, "fields": ["id", "user_id", "title", "content", "status", "created_at"], "limit": 20, "offset": 0, "order_by": "created_at DESC" } ``` | Filter | Description | |---|---| | `user_id` | Filter by author user ID | | `status` | `1` = active only, `0` = inactive only | | `date_from` | Items from this date (`YYYY-MM-DD`) | | `date_to` | Items up to this date (`YYYY-MM-DD`) | --- ## Get Single Breaking News Item ```json { "resource": "breaking", "action": "get", "id": 1 } ``` --- ## Add Breaking News ```json { "resource": "breaking", "action": "add", "user_id": 1, "title": "Breaking: Major event happening now", "content": "Additional details or source URL", "status": 1 } ``` | Field | Required | Notes | |---|---|---| | `user_id` | Yes | ID of the publishing user | | `title` | Yes | Headline shown in the ticker | | `content` | No | Extra details or a URL | | `status` | No | `1` = active (visible), `0` = inactive (hidden). Default: `0` | --- ## Edit Breaking News All fields are optional except `id`. Only fields included in the request are updated. ```json { "resource": "breaking", "action": "edit", "id": 1, "title": "Updated headline", "content": "Updated content", "status": 1 } ``` --- ## Delete Breaking News ```json { "resource": "breaking", "action": "delete", "id": 1 } ```