Get user's notifications
1 min
code examples curl request get \\ \ url 'https //api upstartcommerce com/notifications/v1/notifications?unread only=boolean\&limit=50\&offset=integer' \\ \ header 'accept application/json'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));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 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) responses // 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 }// authentication failed { "error" "", "error description" "", "required scope" "" }// insufficient permissions { "error" "", "error description" "", "required scope" "" }