Organisation

From ToxBank API Wiki
(Difference between revisions)
Jump to: navigation, search
m (Added operations and examples)
m
Line 7: Line 7:
 
== REST Operations ==
 
== REST Operations ==
  
=== GET ===
+
=== GET: Retrieve all organisations ===
 
{{REST Operations
 
{{REST Operations
 
|REST_op_description=Retrieves available organisations
 
|REST_op_description=Retrieves available organisations
 
|REST_resource=Organisation
 
|REST_resource=Organisation
 
|REST_op_method=GET
 
|REST_op_method=GET
|REST_op_uri=/organisation/{id}
+
|REST_op_uri=/organisation
|REST_op_params=none, or ?search=name
+
|REST_op_params=none, or ?search=name or paging parameters: page, pagesize
 
|REST_header_param=subjectid:SECURITY-TOKEN
 
|REST_header_param=subjectid:SECURITY-TOKEN
 
|REST_op_mime_input=none
 
|REST_op_mime_input=none
Line 27: Line 27:
 
             http://toxbanktest1.opentox.org:8080/toxbank/organisation?search=Douglas+Connect
 
             http://toxbanktest1.opentox.org:8080/toxbank/organisation?search=Douglas+Connect
  
===POST ===
+
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 ===
 +
{{REST Operations
 +
|REST_op_description=Retrieves an organisation
 +
|REST_resource=Organisation
 +
|REST_op_method=GET
 +
|REST_op_uri=/organisation/{id}
 +
|REST_op_params=none
 +
|REST_header_param=subjectid:SECURITY-TOKEN
 +
|REST_op_mime_input=none
 +
|REST_op_result=The organisation representation in supported media type
 +
|REST_op_mime_output=application/rdf+xml;text/n3;text/uri-list
 +
|REST_op_status=200,400,401,402,403
 +
}}
 +
Example: [http://toxbanktest1.opentox.org:8080/toxbank/organisation/G1 http://toxbanktest1.opentox.org:8080/toxbank/organisation/G1]
 +
 
 +
curl -X GET -H 'Accept:text/uri-list' -H 'subjectid:TOKEN' http://toxbanktest1.opentox.org:8080/toxbank/organisation/G1
 +
 
 +
===POST: Create a new organisation ===
 
{{REST Operations
 
{{REST Operations
 
|REST_op_description=Creates an organisation
 
|REST_op_description=Creates an organisation
Line 45: Line 65:
 
         -d 'title=MANDATORY_VALUE' -d  'ldapgroup=OPTIONAL_VALUE' http://toxbanktest1.opentox.org:8080/toxbank/organisation
 
         -d 'title=MANDATORY_VALUE' -d  'ldapgroup=OPTIONAL_VALUE' http://toxbanktest1.opentox.org:8080/toxbank/organisation
  
=== PUT ===
+
=== PUT: Update an organisation metadata ===
 
{{REST Operations
 
{{REST Operations
 
|REST_op_description=Updates the organisation metadata
 
|REST_op_description=Updates the organisation metadata
Line 63: Line 83:
 
         -d 'title=MANDATORY_VALUE' -d  'ldapgroup=OPTIONAL_VALUE' http://toxbanktest1.opentox.org:8080/toxbank/organisation/G3
 
         -d 'title=MANDATORY_VALUE' -d  'ldapgroup=OPTIONAL_VALUE' http://toxbanktest1.opentox.org:8080/toxbank/organisation/G3
  
=== DELETE ===
+
=== DELETE: Remove an organisation ===
 
{{REST Operations
 
{{REST Operations
 
|REST_op_description=Removes an existing organisation
 
|REST_op_description=Removes an existing organisation

Revision as of 12:31, 14 December 2011

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 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 -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 -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 -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 [[]]
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


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 [[]]
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


Example:

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

RDF representation

RDF N3

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

Facts about OrganisationRDF feed
Acts on
Has output media typeapplication/rdf+xml;text/n3;text/uri-list  +
Has status code200,202,400,401,402,403,500  +
Personal tools