🔁APIs

Notifications List

Show All notifications of current login user by token

GEThttps://cm.test/api/notifications
Response
Body
success*boolean
message*string
data*string
Request
const response = await fetch('https://cm.test/api/notifications', {
    method: 'GET',
    headers: {},
});
const data = await response.json();
Response
{
  "success": false,
  "message": "text",
  "data": "text"
}

Clear Notifications

Clear all notifications of current user.

POSThttps://cm.test/api/notifications/clear
Body
object
Response
Body
success*boolean
message*string
data*array of string
Request
const response = await fetch('https://cm.test/api/notifications/clear', {
    method: 'POST',
    headers: {
      "Content-Type": "application/json"
    },
});
const data = await response.json();
Response
{
  "success": false,
  "message": "text",
  "data": [
    "text"
  ]
}

Delete Notification

Delete Selected notifications by ID

DELETEhttps://cm.test/api/notifications/{id}/delete
Path parameters
id*string
Body
object
Response
Body
success*boolean
message*string
data*array of string
Request
const response = await fetch('https://cm.test/api/notifications/{id}/delete', {
    method: 'DELETE',
    headers: {
      "Content-Type": "application/json"
    },
});
const data = await response.json();
Response
{
  "success": false,
  "message": "text",
  "data": [
    "text"
  ]
}

Make Notification as Read

You can make the selected notification by id flag to be is_read=true

POSThttps://cm.test/api/notifications/{id}/read
Path parameters
id*string
Body
object
Response
Body
success*boolean
message*string
data*array of string
Request
const response = await fetch('https://cm.test/api/notifications/{id}/read', {
    method: 'POST',
    headers: {
      "Content-Type": "application/json"
    },
});
const data = await response.json();
Response
{
  "success": false,
  "message": "text",
  "data": [
    "text"
  ]
}

Update Notification Token

update notification token for FCM integration token

POSThttps://cm.test/api/notifications/toggle
Body
tokenstringnull
Response
Body
success*boolean
message*string
body*array of string
Request
const response = await fetch('https://cm.test/api/notifications/toggle', {
    method: 'POST',
    headers: {
      "Content-Type": "application/json"
    },
    body: JSON.stringify({}),
});
const data = await response.json();
Response
{
  "success": false,
  "message": "text",
  "body": [
    "text"
  ]
}

Last updated