...
Prerequisites
- Valid access token.
- Access to Virtual Machine
Step-by-step guide
Request notification settings are available via the /v2/user/setting/notification/request resource and are displayed by making a GET request to the mentioned URI as follows:
Code Block http https://vss-api.eis.utoronto.ca/v2/user/setting/notification/request "Authorization: Bearer $TK" curl -H "Authorization: Bearer $TK" -X GET https://vss-api.eis.utoronto.ca/v2/user/setting/notification/request
Code Block language py title Response Body { "_links": { "notification": "https://vss-api.eis.utoronto.ca/v2/user/setting/notification", "self": "https://vss-api.eis.utoronto.ca/v2/user/setting/notification/request" }, "data": { "all": true, "completion": false, "error": false, "none": false, "submission": false }, "meta": { "count": 5, "time": "0.00190s", "user": "jm" } }
Updating request notification settings can be done by making a PUT request to /v2/user/setting/notification/request adding as payload the following JSON object:
Code Block {"attribute": <attribute> "value": <boolean>}
In this case, updating the request notifications to receive only requests with error status requires to set first all=false and then error=true as follows:
Code Block # HTTPie http PUT https://vss-api.eis.utoronto.ca/v2/user/setting/notification/request "Authorization: Bearer $TK" attribute=all value:=false http PUT https://vss-api.eis.utoronto.ca/v2/user/setting/notification/request "Authorization: Bearer $TK" attribute=error value:=true # CURL curl -H "Authorization: Bearer $TK" -X POST -H "Content-Type: application/json" https://vss-api.eis.utoronto.ca/v2/user/setting/notification/request -d '{"attribute": "all", "value": false}' curl -H "Authorization: Bearer $TK" -X POST -H "Content-Type: application/json" https://vss-api.eis.utoronto.ca/v2/user/setting/notification/request -d '{"attribute": "error", "value": true}'
Note An empty response with status 200 will be returned if the operation was successful
To validate changes were successfully applied:
Code Block http https://vss-api.eis.utoronto.ca/v2/user/setting/notification/request "Authorization: Bearer $TK" curl -H "Authorization: Bearer $TK" -X GET https://vss-api.eis.utoronto.ca/v2/user/setting/notification/request
Code Block language py title Response Body { "_links": { "notification": "https://vss-api.eis.utoronto.ca/v2/user/setting/notification", "self": "https://vss-api.eis.utoronto.ca/v2/user/setting/notification/request" }, "data": { "all": false, "completion": false, "error": true, "none": false, "submission": false }, "meta": { "count": 5, "time": "0.00188s", "user": "jm" } }
...
Page Properties | |||
---|---|---|---|
| |||
|