NowSecure utilizes the Apollo Sandbox that provides an environment to perform GraphQL API queries and mutations on completed assessments, organization details, apps, and much more in NowSecure Platform to obtain detailed results.
For all API calls, replace the $API_TOKEN
with your own token. Create a token by selecting the Profile icon on the top right corner of Platform > select Tokens. See Creating an API Bearer Token in NowSecure Platform for further information.
Alerts
The myAlerts
query node takes two arguments: the isRead
parameter allows filtering strictly for alerts that have been either read or unread (if unspecified, both read and unread alerts will be returned.) The sortDescending
parameter allows for fetching alerts by most recent first, rather than the default chronological order (the order alerts were created).
To query for alerts for the authenticated user, use the myAlerts query node. For example, use this query for all unread alerts with most recent alerts sorted first.
POSTquery {
alerts {
myAlerts(isRead: false, sortDescending: true) {
id
eventType
createdAt
readAt
}
}
}
curl \
-X POST \
-H "Authorization: Bearer $API_TOKEN" \
-H "Content-Type: application/json" \
--data '{ "query": "{ alerts { myAlerts(isRead: false, sortDescending: true) { id eventType createdAt readAt } } }" }' \
https://api.nowsecure.com/graphql
{
"data": {
"alerts": {
"myAlerts": [
{
"id": 6172,
"eventType": "ASSESSMENT_DONE",
"createdAt": "2019-02-08T19:11:21.109Z",
"readAt": true
},
{
"id": 6171,
"eventType": "ASSESSMENT_DONE",
"createdAt": "2019-02-08T16:10:56.258Z",
"readAt": true
}
]
}
}
}
Comments
Article is closed for comments.