Skip to content

User - Notices

Base URL: https://your-domain.com

Admin endpoints for managing system notices/announcements. All endpoints require admin/staff authentication.


Fetch All Notices

Retrieve all notices.

PropertyValue
EndpointFetch All Notices
MethodGET
URL/api/v1/notices
AuthenticationBearer Token

Request Headers:

HeaderValueRequired
Acceptapplication/jsonYes
AuthorizationBearer your-auth-tokenYes

Success Response (200 OK):

json
{
    "success": true,
    "data": [
        {
            "id": 1,
            "title": "Maintenance Notice",
            "content": "Scheduled maintenance tonight",
            "is_active": true,
            "created_at": "2024-01-15 10:30:00"
        }
    ]
}

Fetch Notice

Retrieve details of a specific notice.

PropertyValue
EndpointFetch Notice
MethodGET
URL/api/v1/notices/{id}
AuthenticationBearer Token

Success Response (200 OK):

json
{
    "success": true,
    "data": {
        "id": 1,
        "title": "Maintenance Notice",
        "content": "Scheduled maintenance tonight from 10 PM to 2 AM",
        "is_active": true,
        "created_by": "Admin",
        "created_at": "2024-01-15 10:30:00"
    }
}

Create Notice

Create a new notice/announcement.

PropertyValue
EndpointCreate Notice
MethodPOST
URL/api/v1/notices
AuthenticationBearer Token

Request Body:

json
{
    "isp_id": 1,
    "branch_id": 1,
    "user_id": 1,
    "title": "Maintenance Notice",
    "content": "Scheduled maintenance tonight",
    "is_active": true
}
ParameterTypeRequiredDescription
titlestringYesNotice title
contentstringYesNotice content
is_activebooleanNoWhether notice is active

Success Response (201 Created):

json
{
    "success": true,
    "message": "Notice created successfully",
    "data": {
        "id": 1
    }
}

Update Notice

Update an existing notice.

PropertyValue
EndpointUpdate Notice
MethodPUT
URL/api/v1/notices/{id}
AuthenticationBearer Token

Request Body:

json
{
    "title": "Updated Notice",
    "is_active": false
}

Success Response (200 OK):

json
{
    "success": true,
    "message": "Notice updated successfully"
}

Delete Notice

Delete a notice.

PropertyValue
EndpointDelete Notice
MethodDELETE
URL/api/v1/notices/{id}
AuthenticationBearer Token

Success Response (200 OK):

json
{
    "success": true,
    "message": "Notice deleted successfully"
}

www.onezeroart.com