Get user's notifications
1 min
GET
https://api.upstartcommerce.com/notifications/v1/notifications
Query Parameters
- unread_onlybooleanDescriptionDefaultfalse
- limitintegerDescriptionDefault50Minimum1Maximum100
- offsetintegerDescriptionDefault0Minimum0
Responses
200
- GetNotificationsResponse
- notificationsNotificationEvent[]required
- eventIdstring<uuid>requiredDescriptionFormatuuid
- eventTypestringrequiredExampleDescription
- titlestringrequiredExampleDescription
- messagestringrequiredExampleDescription
- timestampstring<date-time>requiredDescriptionFormatdate-time
- userIdstring<uuid>requiredDescriptionFormatuuid
- tenantIdstringrequiredDescription
- prioritystring<LOW | NORMAL | HIGH | URGENT>requiredDescriptionAllowedLOWNORMALHIGHURGENT
- datamap<string, string>Description
- readAtstring<date-time>DescriptionFormatdate-time
- isReadbooleanrequiredDescription
- totalCountintegerrequiredDescription
- unreadCountintegerrequiredDescription
- hasMorebooleanrequiredDescription
401
- ErrorResponse
- errorstring<authentication_failed | insufficient_permissions | invalid_request | not_found>requiredDescriptionAllowedauthentication_failedinsufficient_permissionsinvalid_requestnot_found
- error_descriptionstringrequiredDescription
- required_scopestringDescription
403
- ErrorResponse
- errorstring<authentication_failed | insufficient_permissions | invalid_request | not_found>requiredDescriptionAllowedauthentication_failedinsufficient_permissionsinvalid_requestnot_found
- error_descriptionstringrequiredDescription
- required_scopestringDescription
curl
curl --request GET \
--url 'https://api.upstartcommerce.com/notifications/v1/notifications?unread_only=boolean&limit=50&offset=integer' \
--header 'accept: application/json'javascript
var myHeaders = new Headers();
myHeaders.append("accept", "application/json");
myHeaders.append("content-type", "application/json");
var requestOptions = {
method: 'GET',
headers: myHeaders,
redirect: 'follow'
};
fetch("https://api.upstartcommerce.com/notifications/v1/notifications?unread_only=boolean&limit=50&offset=integer", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));ruby
require "uri"
require "json"
require "net/http"
url = URI("https://api.upstartcommerce.com/notifications/v1/notifications?unread_only=boolean&limit=50&offset=integer")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Get.new(url)
request["accept"] = "application/json"
request["content-type"] = "application/json"
response = https.request(request)
puts response.read_body
python
import requests
import json
url = "https://api.upstartcommerce.com/notifications/v1/notifications?unread_only=boolean&limit=50&offset=integer"
payload = {}
headers = {
'accept': 'application/json',
'content-type': 'application/json'
}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)
200
// Notifications retrieved successfully
{
"notifications": [
{
"eventId": "",
"eventType": "system_alert",
"title": "System Maintenance",
"message": "Scheduled maintenance will begin at 2 AM UTC",
"timestamp": "",
"userId": "",
"tenantId": "",
"priority": "",
"data": "",
"readAt": "",
"isRead": false
}
],
"totalCount": 0,
"unreadCount": 0,
"hasMore": false
}401
// Authentication failed
{
"error": "",
"error_description": "",
"required_scope": ""
}403
// Insufficient permissions
{
"error": "",
"error_description": "",
"required_scope": ""
}