Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Muhammadbugaje/NAMETS_Website/llms.txt

Use this file to discover all available pages before exploring further.

This endpoint returns all active (is_active = True) announcements whose publish_at datetime is greater than or equal to a given point in time. It is designed for automation workflows (such as n8n) that poll for new content and need only the records published since their last run. When no since parameter is provided, the server defaults to 24 hours ago, ensuring no recent announcements are missed.

Endpoint paths

PathSource module
GET /api/announcements/new/api/views.py
GET /api/communications/announcements/new/communications/views_api.py
Both paths require the X-N8N-Token header and return the same data. The /api/communications/ path additionally exposes expire_at and category fields from the communications serializer (see response fields below).

Query parameters

since
string
An ISO 8601 datetime string representing the earliest publish_at value to include. Announcements published at or after this time are returned.The /api/ path accepts the Z UTC suffix (e.g., 2024-01-01T00:00:00Z) and converts it internally. The /api/communications/ path uses fromisoformat directly and accepts offset-aware strings such as 2024-01-01T00:00:00+00:00.If omitted, or if the supplied value cannot be parsed, the server falls back to 24 hours before the current time.Example: ?since=2024-06-01T08:00:00Z
When since is not provided, the server automatically uses now - 24 hours as the lower bound. This means a polling workflow that runs every 24 hours will never miss an announcement, as long as it runs on schedule.

Response fields

Fields returned by both endpoint paths:
id
integer
The unique primary key of the announcement.
title
string
The announcement headline, up to 200 characters.
content
string
The full announcement body text. May be null if no content was entered.
publish_at
string
The scheduled publish datetime in ISO 8601 format (e.g., "2024-06-15T10:00:00Z"). This is also the field used for the since filter comparison.
Additional fields returned only by /api/communications/announcements/new/:
expire_at
string
The datetime after which the announcement is considered expired, in ISO 8601 format. May be null if no expiry is set.
category
string
The announcement category. One of: "general", "ramadan", "taaleem", "sale".

Examples

Fetch announcements from the last 24 hours (default window):
curl -H "X-N8N-Token: your_api_token" \
  https://your-site.onrender.com/api/announcements/new/
Fetch announcements published since a specific timestamp:
curl -H "X-N8N-Token: your_api_token" \
  "https://your-site.onrender.com/api/announcements/new/?since=2024-06-01T00:00:00Z"
Via the communications path (includes category and expire_at):
curl -H "X-N8N-Token: your_api_token" \
  "https://your-site.onrender.com/api/communications/announcements/new/?since=2024-06-01T00:00:00Z"

Example response

Response from GET /api/announcements/new/:
[
  {
    "id": 14,
    "title": "Jumu'ah Prayer Time Update",
    "content": "This Friday's Jumu'ah will begin at 1:15 PM in the Engineering Mosque. All brothers are encouraged to arrive early.",
    "publish_at": "2024-06-14T09:00:00Z"
  },
  {
    "id": 15,
    "title": "Ramadan Tafseer Sessions",
    "content": "Daily post-Fajr Tafseer sessions will be held throughout Ramadan. Attendance is open to all students.",
    "publish_at": "2024-06-14T11:30:00Z"
  }
]
Response from GET /api/communications/announcements/new/ (additional fields):
[
  {
    "id": 14,
    "title": "Jumu'ah Prayer Time Update",
    "content": "This Friday's Jumu'ah will begin at 1:15 PM in the Engineering Mosque.",
    "publish_at": "2024-06-14T09:00:00Z",
    "expire_at": "2024-06-14T20:00:00Z",
    "category": "general"
  }
]

Build docs developers (and LLMs) love