POST
/

Use this API to update notifications.

Endpoint

POST https://updatenotifications.api.velt.dev/

Headers

x-velt-api-key
string
required

Your API key.

x-velt-auth-token
string
required

Body Example

Params

data
object
required

Example Requests

1. Update by organizationId and documentId

{
   "data": {
       "organizationId": "yourOrganizationId",
       "documentId": "yourDocumentId",
       "notifications": [
           {
               "id": "yourNotificationId",
               "displayBodyMessage": "This is body message (Secondary message)",
           }
       ]
   }
}

2. Update by organizationId, documentId and locationId

{
   "data": {
       "organizationId": "yourOrganizationId",
       "documentId": "yourDocumentId",
       "locationId": "yourLocationId",
       "notifications": [
           {
               "id": "yourNotificationId",
               "displayBodyMessage": "This is body message (Secondary message)",
           }
       ]
   }
}

3. Update by organizationId, documentId and userId

{
   "data": {
       "organizationId": "yourOrganizationId",
       "documentId": "yourDocumentId",
       "userId": "yourUserId",
       "notifications": [
           {
               "id": "yourNotificationId",
               "displayBodyMessage": "This is body message (Secondary message)",
           }
       ]
   }
}

4. Update by organizationId and userId

{
   "data": {
       "organizationId": "yourOrganizationId",
       "userId": "yourUserId",
       "notifications": [
           {
               "id": "yourNotificationId",
               "displayBodyMessage": "This is body message (Secondary message)",
           }
       ]
   }
}

5. Update by organizationId, documentId, locationId and userId

{
   "data": {
       "organizationId": "yourOrganizationId",
       "documentId": "yourDocumentId",
       "userId": "yourUserId",
       "locationId": "yourLocationId",
       "notifications": [
           {
               "id": "yourNotificationId",
               "displayBodyMessage": "This is body message (Secondary message)",
           }
       ]
   }
}

Response

Success Response

{
   "result": {
       "status": "success",
       "message": "Notification(s) updated successfully.",
       "data": {
           "5471488637912692": {
               "success": true,
               "message": "Notification updated."
           }
       }
   }
}

When some notifications are not found

{
   "result": {
       "status": "success",
       "message": "Notification(s) updated successfully.",
       "data": {
           "5471488637912692": {
               "success": false,
               "message": "Failed to update notification."
           },
           "5471488637912693": {
               "success": true,
               "message": "Notification updated."
           }
       }
   }
}

Failure Response

{
  "error": {
    "message": "ERROR_MESSAGE",
    "status": "INVALID_ARGUMENT"
  }
}