Alert
From ToxBank API Wiki
Contents |
Alerts
An Alert is defined by Query URI ,frequency and an User to be notified.
(could be also groups instead of users?)
N3 representation of an alert
<http://toxbank.net/services/alerts/Alert_33> a tb:Alert ; dc:title "My first alert"; tb:hasQuery <http://toxbank.net/services/query/Q456>; tb:frequency tb:Daily; tb:userToBeNotified <http://toxbank.net/services/user/U8247634857324857>.
Retrieve alerts
Description | Retrieve alerts |
---|---|
Resource | Alert |
Method | GET |
URI | /user/{obfuscatedid}/alerts |
Parameters | TBD, search paratemers to filter alerts |
Header Parameters | subjectid:SECURITY-TOKEN |
Media Type (input) | |
Results | content in supported formats |
Media Type (output) | text/uri-list, RDF, JSON |
Status code | 200,202,400,401,402,403 |
Links: Page, Edit with form
cURL example
$curl -X GET http://toxbank.net/services/alerts -H "Accept:text/n3" .... <http://toxbank.net/services/alerts/Alert_33> a tb:Alert ; dc:title "My first alert"; tb:hasQuery <http://toxbank.net/services/query/Q456>; tb:frequency tb:Daily; tb:userToBeNotified <http://toxbank.net/services/user/U8247634857324857>. <http://toxbank.net/services/alerts/Alert_34> a tb:Alert ; dc:title "My second alert"; tb:hasQuery <http://toxbank.net/services/query/Q789>; tb:frequency tb:Weekly; tb:userToBeNotified <http://toxbank.net/services/user/U8247634857324857>.
Create an alert
Description | Creates an alert |
---|---|
Resource | Alert |
Method | POST |
URI | /user/{obfuscatedid}/alerts |
Parameters | query uri, frequency (predefined list),name |
Header Parameters | subjectid:SECURITY-TOKEN |
Media Type (input) | application/x-www-form-urlencoded, RDF, JSON |
Results | Task URI, when complete - URI of the new alert , e.g. /user/U8247634857324857/alerts/Alert_5678 |
Media Type (output) | text/uri-list |
Status code | 200,202,400,401,402,403 |
Links: Page, Edit with form
cURL example
$curl -X POST http://toxbank.net/services/alerts -d "query=http://toxbank.net/services/query/Q789" -d "frequency=Weekly" >HTTP/1.1 200 OK >http://toxbank.net/services/alerts/Alert_34
Retrieve an Alert
Description | Retrieve an alert |
---|---|
Resource | Alert |
Method | GET |
URI | /user/{obfuscatedid}/alerts/{id} |
Parameters | |
Header Parameters | subjectid:SECURITY-TOKEN |
Media Type (input) | |
Results | content in supported formats |
Media Type (output) | text/uri-list, RDF, JSON |
Status code | 200,202,400,401,402,403 |
Links: Page, Edit with form
Update an Alert
Description | Update an alert |
---|---|
Resource | Alert |
Method | PUT |
URI | /user/{obfuscatedid}/alerts/{id} |
Parameters | |
Header Parameters | subjectid:SECURITY-TOKEN |
Media Type (input) | application/x-www-form-urlencoded, RDF, JSON |
Results | Task uri, including error reports |
Media Type (output) | text/uri-list |
Status code | 200,202,400,401,402,403 |
Links: Page, Edit with form
Delete an Alert
Description | Deletes an alert |
---|---|
Resource | Alert |
Method | DELETE |
URI | /user/{obfuscatedid}/alerts/{id} |
Parameters | nons |
Header Parameters | subjectid:SECURITY-TOKEN |
Media Type (input) | none |
Results | |
Media Type (output) | text/uri-list |
Status code | 200,202,400,401,402,403 |
Links: Page, Edit with form