Notification APIs
Click an API to expand/collapse it.
- Description
-
Fetches a notification by notification ID.
-
The GET Response body (JSON) includes the following important keyname/value pairs - see the Response body code example:
"context":
Value is an id (Publisher Id, Reviewer Id) to whom the notification is available.
"contextType":
Value is a type (PUBLISHER, REVIEWER, etc.) to whom the notification is available.
"action":
Value is an id of the type of notification (application id).
"actionType":
Value is the type of notification (APPLICATION_VERSION).
"consumed":
Value is a boolean; if true the notification is consumed.
"text":
Value is a text string; the notification text.
- Request Endpoint
- GET https://<Example api server address>/notification/{notificationId}
- Parameters
-
Parameter |
Type |
Use |
Description |
notificationId |
String |
Required |
The notification id. |
- cURL syntax
-
curl --include \
'https://impk.ntg.Example.net/notification/{notificationId}'
- Response body
-
Headers: Content-Type: application/json | HTTPS Status Code: 200
{
"data": {
"id": "216a6123-108f-46c7-9af8-829265c05967",
"createdOn": 1482256130097,
"lastModifiedOn": 1482256130097,
"updatedBy": "",
"deleted": false,
"text": "Submitted to review",
"context": "fa862b93-e3da-4c30-9319-0a80797bf7f1",
"contextType": "REVIEWER",
"actionType": "APPLICATION_VERSION",
"action": "b889d886-16e6-4cd7-893c-2ee29883cd5f",
"consumed": false
},
"detail": null,
"error": false,
"message": "Notification is fetched successfully",
"code": "1000"
}
Return to top
- Description
-
Fetches all non-consumed notifications by context and/or action.
-
Important note: Either one or both combinations are required.
- If "contextType" is passed, "context" is mandatory/required.
- If "actionType" is passed, "action" is mandatory/required.
-
Combinations : context & contextType / action & actionType
"context":
An id (Publisher id, Reviewer id) to whom the notification is available.
"contextType":
A type (PUBLISHER, REVIEWER etc.) to whom the notification is available.
"action":
An id of the type of notification (applicationId).
"actionType":
The type of notification (APPLICATION_VERSION).
- Request Endpoint
- POST https://<Example api server address>/notification/all
- Parameters
-
None.
- cURL syntax
-
curl --include \
--request POST \
--header "Content-Type: application/json" \
--data-binary "{
\"contextType\": \"REVIEWER\",
\"context\": \"fa862b93-e3da-4c30-9319-0a80797bf7f1\",
\"actionType\": \"APPLICATION\",
\"action\": \"b889d886-16e6-4cd7-893c-2ee29883cd5f\"
}" \
'https://impk.ntg.Example.net/notification/all'
- POST body attributes (JSON)
-
Attribute |
Type |
Use |
Description |
context |
String |
Conditional |
The context id; if "contextType" is passed, it is mandatory/required. |
contextType |
String |
Optional |
An action type string; at present, this is "APPLICATION_VERSION". |
action |
String |
Conditional |
An action id; if "actionType" is passed, it is mandatory/required. |
actionType |
String |
Optional |
The type of notification, i.e., "APPLICATION_VERSION". |
- POST body
-
Headers: Content-Type: application/json
{
"contextType": "REVIEWER",
"context": "fa862b93-e3da-4c30-9319-0a80797bf7f1",
"actionType": "APPLICATION",
"action": "b889d886-16e6-4cd7-893c-2ee29883cd5f"
}
- Response body
-
Headers: Content-Type: application/json | HTTPS Status Code: 200
{
"data": [
{
"id": "216a6123-108f-46c7-9af8-829265c05967",
"createdOn": 1482256130097,
"lastModifiedOn": 1482256130097,
"updatedBy": "",
"deleted": false,
"text": "Submitted to review",
"context": "fa862b93-e3da-4c30-9319-0a80797bf7f1",
"contextType": "REVIEWER",
"actionType": "APPLICATION_VERSION",
"action": "b889d886-16e6-4cd7-893c-2ee29883cd5f",
"consumed": false
}
],
"detail": null,
"error": false,
"message": "Consumed notification is fetched successfully",
"code": "1000"
}
Return to top
- Description
- Important: This service is required for the notification bubble in the UI.
- Request Endpoint
- PUT https://<Example api server address>/consume/{notificationId}
- Parameters
-
Parameter |
Type |
Use |
Description |
notificationId |
String |
Required |
The notification id. |
- cURL syntax
-
curl --include \
--request PUT \
'https://private-f72cd-betcadedeveloperportal.apiary-mock.com/notification/consume/{notificationId}'
- Response body
-
Headers: Content-Type: application/json | HTTPS Status Code: 200
{
"data": {
"id": "ea494c91-8541-4eb8-bd24-905c68df3ca6",
"createdOn": 1482321848892,
"lastModifiedOn": 1482321848892,
"updatedBy": "",
"deleted": false,
"text": "Application is approved by reviewer.",
"context": "3eb66c9e-a567-4684-8f31-0c45b1eac5c8",
"contextType": "PUBLISHER",
"actionType": "APPLICATION_VERSION",
"action": "e812624a-5659-43e8-b131-8fe5c3ebc8df",
"consumed": true
},
"detail": null,
"error": false,
"message": "Notification is consumed successfully",
"code": "1000"
}
Return to top