User
m (→Retrieve user details) |
m |
||
Line 10: | Line 10: | ||
= REST interface = | = REST interface = | ||
− | == GET: Retrieve users == | + | == User related operations == |
+ | === GET: Retrieve users === | ||
{{HasOperation |id=User:RetrieveList}} | {{HasOperation |id=User:RetrieveList}} | ||
Example: [http://toxbanktest1.opentox.org:8080/toxbank/user http://toxbanktest1.opentox.org:8080/toxbank/user] | Example: [http://toxbanktest1.opentox.org:8080/toxbank/user http://toxbanktest1.opentox.org:8080/toxbank/user] | ||
− | === cURL example === | + | ==== cURL example ==== |
curl -X GET -H 'Accept:text/uri-list' -H 'subjectid:TOKEN' http://toxbanktest1.opentox.org:8080/toxbank/user | curl -X GET -H 'Accept:text/uri-list' -H 'subjectid:TOKEN' http://toxbanktest1.opentox.org:8080/toxbank/user | ||
Line 20: | Line 21: | ||
curl -X GET -H 'Accept:text/uri-list' -H 'subjectid:TOKEN' http://toxbanktest1.opentox.org:8080/toxbank/user?page=0&pagesize=5 | curl -X GET -H 'Accept:text/uri-list' -H 'subjectid:TOKEN' http://toxbanktest1.opentox.org:8080/toxbank/user?page=0&pagesize=5 | ||
− | == Retrieve user details == | + | === GET: Retrieve user details === |
{{HasOperation |id=User:Details}} | {{HasOperation |id=User:Details}} | ||
− | === cURL example === | + | ==== cURL example ==== |
curl -X GET -H 'Accept:application/rdf+xml' -H 'subjectid:TOKEN' http://toxbanktest1.opentox.org:8080/toxbank/user/U1 | curl -X GET -H 'Accept:application/rdf+xml' -H 'subjectid:TOKEN' http://toxbanktest1.opentox.org:8080/toxbank/user/U1 | ||
− | == Retrieve My Protocols == | + | |
+ | == Protocol related operations == | ||
+ | === Retrieve My Protocols === | ||
Same as [[API_Protocol:RetrieveList]], but filtered by the user. | Same as [[API_Protocol:RetrieveList]], but filtered by the user. | ||
Line 31: | Line 34: | ||
{{HasOperation |id=User:RetrieveProtocols}} | {{HasOperation |id=User:RetrieveProtocols}} | ||
− | == Retrieve My Studies == | + | === Retrieve My Studies === |
Same as [[API_Study:RetrieveList]], but filtered by the user. | Same as [[API_Study:RetrieveList]], but filtered by the user. | ||
Line 37: | Line 40: | ||
{{HasOperation |id=User:RetrieveStudies}} | {{HasOperation |id=User:RetrieveStudies}} | ||
− | == My alerts == | + | === My alerts === |
{{HasOperation |id=User:RetrieveAlerts}} | {{HasOperation |id=User:RetrieveAlerts}} |
Revision as of 12:50, 14 December 2011
User |
---|
An User is a REST resource,representing users from SEURAT cluster, or external users. An User is identified by its URI, and may be assigned an LDAP user name. The LDAP user name should be one of the existing ToxBank LDAP accounts and accessible via ToxBank OpenAM. External users may or may not be assigned an LDAP user name.
A Protocol is always associated with a single user, considered its owner, and the protocol representation includes a link to the owner URI. The owner URI should be an user with a valid LDAP user name. The protocol owner is assigned automatically, when the protocol is uploaded by a logged-in user. Non registered users are not allowed to upload protocols.
A Protocol may be associated with one or more users, considered its authors. The protocol representation includes links to the author URIs.
Contents |
REST interface
GET: Retrieve users
Description | Retrieve list of users |
---|---|
Resource | User |
Method | GET |
URI | /user |
Parameters | none, or ?search=prefix_of_firstname_or_lastname or paging parameters: page, pagesize or ?username=USERNAME |
Header Parameters | subjectid:SECURITY-TOKEN |
Media Type (input) | none |
Results | The project representation in supported media type |
Media Type (output) | application/rdf+xml;text/n3;text/uri-list |
Status code | 200,400,401,402,403 |
Links: Page, Edit with form
Example: http://toxbanktest1.opentox.org:8080/toxbank/user
cURL example
curl -X GET -H 'Accept:text/uri-list' -H 'subjectid:TOKEN' http://toxbanktest1.opentox.org:8080/toxbank/user
curl -X GET -H 'Accept:application/rdf+xml' -H 'subjectid:TOKEN' http://toxbanktest1.opentox.org:8080/toxbank/user?search=J
curl -X GET -H 'Accept:text/uri-list' -H 'subjectid:TOKEN' http://toxbanktest1.opentox.org:8080/toxbank/user?page=0&pagesize=5
GET: Retrieve user details
Description | Retrieve user details |
---|---|
Resource | User |
Method | GET |
URI | /user/{obfuscated_id} |
Parameters | none |
Header Parameters | subjectid:SECURITY-TOKEN |
Media Type (input) | none |
Results | The user representation in supported media type |
Media Type (output) | application/rdf+xml;text/n3;text/uri-list |
Status code | 200,400,401,402,403 |
Links: Page, Edit with form
cURL example
curl -X GET -H 'Accept:application/rdf+xml' -H 'subjectid:TOKEN' http://toxbanktest1.opentox.org:8080/toxbank/user/U1
Retrieve My Protocols
Same as API_Protocol:RetrieveList, but filtered by the user.
Description | Retrieves list of protocols, including metadata, filtered by the user |
---|---|
Resource | User |
Method | GET |
URI | /user/{obfuscated_id}/protocols |
Parameters | TBD , search parameters to query/filter protocols |
Header Parameters | subjectid:SECURITY-TOKEN |
Media Type (input) | none |
Results | List of protocols in supported MIME formats |
Media Type (output) | text/uri-list, RDF, JSON, XML |
Status code | 200, 400, 401, 402, 403 |
Links: Page, Edit with form
Retrieve My Studies
Same as API_Study:RetrieveList, but filtered by the user.
Description | Retrieves list of studies, including metadata, filtered by the user |
---|---|
Resource | User |
Method | GET |
URI | /user/{obfuscated_id}/study |
Parameters | TBD , search options to query/filter studies |
Header Parameters | subjectid:SECURITY-TOKEN |
Media Type (input) | none |
Results | List of studies in supported Media Type formats |
Media Type (output) | text/uri-list, RDF, JSON, XML |
Status code | 200,400,401,402,403 |
Links: Page, Edit with form
My alerts
Description | Retrieves list of alerts, filtered by the user |
---|---|
Resource | User |
Method | GET |
URI | /user/{obfuscated_id}/alerts |
Parameters | TBD , search options to query/filter alerts |
Header Parameters | subjectid:SECURITY-TOKEN |
Media Type (input) | none |
Results | List of alerts in supported Media Type formats |
Media Type (output) | text/uri-list;application/rdf+xml;text/n3 |
Status code | 200,400,401,402,403 |
Links: Page, Edit with form
Authors and users
Protocols and data uploaded to the system can refer to persons and organisations as authors or owners, without requiring them to be registered Toxbank users or organisations.
This could be implemented by allowing authors and organisations to be assigned entry in the system, but not associated with AA / LDAP user name or group name.
OpenAM
Currently, User details can be retrieved by requesting OpenAM attributes, given a valid token.
Java library
http://vedina.github.com/opentox-aa-cli/
Ruby library
...
HasOperation | RetrieveList +, Details +, RetrieveProtocols +, RetrieveStudies + and RetrieveAlerts + |