Organisation

From ToxBank API Wiki
Jump to: navigation, search
Organisation


An organisation is a REST resource,representing SEURAT cluster partners, or external organisations. An organisation is identified by its URI, has a name and may be assigned an LDAP group. The LDAP group should be one of the existing ToxBank LDAP groups and accessible via ToxBank OpenAM. External organisations may or may not be assigned an LDAP group.

A Protocol is always associated with an organisation,and the protocol representation includes a link to an Organisation.

Contents

REST Operations

GET: Retrieve all organisations

Description Retrieves available organisations
Resource Organisation
Method GET
URI /organisation
Parameters none, or ?search=name_prefix or paging parameters: page, pagesize
Header Parameters subjectid:SECURITY-TOKEN
Media Type (input) none
Results The organisation representation in supported media type
Media Type (output) application/rdf+xml;text/n3;text/uri-list
Status code 200,400,401,402,403

Example: http://toxbanktest1.opentox.org:8080/toxbank/organisation

cURL example

curl -X GET -H 'Accept:text/uri-list' -H 'subjectid:TOKEN' http://toxbanktest1.opentox.org:8080/toxbank/organisation
curl -X GET -H 'Accept:application/rdf+xml' -H 'subjectid:TOKEN' \
           http://toxbanktest1.opentox.org:8080/toxbank/organisation?search=Douglas+Connect
curl -X GET -H 'Accept:text/uri-list' -H 'subjectid:TOKEN' \
           http://toxbanktest1.opentox.org:8080/toxbank/organisation?page=0&pagesize=3

GET: Retrieve an organisation

Description Retrieves an organisation
Resource Organisation
Method GET
URI /organisation/{id}
Parameters none
Header Parameters subjectid:SECURITY-TOKEN
Media Type (input) none
Results The organisation representation in supported media type
Media Type (output) application/rdf+xml;text/n3;text/uri-list
Status code 200,400,401,402,403

Example: http://toxbanktest1.opentox.org:8080/toxbank/organisation/G1

cURL example

curl -X GET -H 'Accept:text/uri-list' -H 'subjectid:TOKEN' http://toxbanktest1.opentox.org:8080/toxbank/organisation/G1

POST: Create a new organisation

Description Creates an organisation
Resource Organisation
Method POST
URI /organisation
Parameters Any combination of name,ldapgroup
Header Parameters subjectid:SECURITY-TOKEN
Media Type (input) application/x-www-form-urlencoded
Results Task representation in supported MIME formats
Media Type (output) application/rdf+xml;text/n3;text/uri-list
Status code 200,202,400,401,402,403,500

Example: http://toxbanktest1.opentox.org:8080/toxbank/organisation

cURL example

curl -X POST -H 'subjectid:TOKEN' -H 'Content-Type:application/x-www-form-urlencoded' \
       -d 'title=MANDATORY_VALUE' -d  'ldapgroup=OPTIONAL_VALUE' http://toxbanktest1.opentox.org:8080/toxbank/organisation

PUT: Update an organisation metadata

Description Updates the organisation metadata
Resource Organisation
Method PUT
URI /organisation/{id}
Parameters Any combination of name,ldapgroup
Header Parameters subjectid:SECURITY-TOKEN
Media Type (input) application/x-www-form-urlencoded
Results Task representation in supported MIME formats
Media Type (output) application/rdf+xml;text/n3;text/uri-list
Status code 200,202,400,401,402,403,500

cURL example

curl -X PUT -H 'subjectid:TOKEN' -H 'Content-Type:application/x-www-form-urlencoded' \
       -d 'title=MANDATORY_VALUE' -d  'ldapgroup=OPTIONAL_VALUE' http://toxbanktest1.opentox.org:8080/toxbank/organisation/G3

DELETE: Remove an organisation

Description Removes an existing organisation
Resource Organisation
Method DELETE
URI /organisation/{id}
Parameters none
Header Parameters subjectid:SECURITY-TOKEN
Media Type (input) none
Results Task representation in supported MIME formats
Media Type (output) application/rdf+xml;text/n3;text/uri-list
Status code 200,202,400,401,402,403,500

cURL example

curl -X DELETE -H 'subjectid:TOKEN' http://toxbanktest1.opentox.org:8080/toxbank/organisation/G3

RDF representation

Stable version

RDF N3

This RDF representation is automatically generated by the production version of the Toxbank Java client library

Alpha test version

RDF/N3

This RDF representation is automatically generated by the alpha test version of the Toxbank Java client library

Development version

RDF/N3

This RDF representation is automatically generated by the latest version of the Toxbank Java client library

Example in RDF/XML format

<?xml version="1.0"?>
<!DOCTYPE rdf:RDF [
  <!ENTITY tb 'http://onto.toxbank.net/api/'>
  <!ENTITY xsd 'http://www.w3.org/2001/XMLSchema#'>
  <!ENTITY tbo 'http://toxbanktest1.opentox.org:8080/toxbank/organisation/'>
  <!ENTITY rdf 'http://www.w3.org/1999/02/22-rdf-syntax-ns#'>
  <!ENTITY tbpt 'http://toxbanktest1.opentox.org:8080/toxbank/project/'>
  <!ENTITY dcterms 'http://purl.org/dc/terms/'>]>
<rdf:RDF
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:tbo="&tbo;"
    xmlns:dcterms="&dcterms;"
    xmlns:xsd="&xsd;"
    xmlns:tbpt="&tbpt;"
    xmlns:tb="&tb;">
  <tb:Organization rdf:about="&tbo;G210">
    <dcterms:title rdf:datatype="&xsd;string">ToxBank</dcterms:title>
  </tb:Organization>
</rdf:RDF>

Security

SEURAT-1 access

Organisation information can be retrieved by members of groups scrtox,hemibio,notox,cosmos,toxbank,detective,sep.

The policies can be browsed here.

Personal tools