API Investigation:Create

From ToxBank API Wiki
(Difference between revisions)
Jump to: navigation, search
Line 11: Line 11:
 
* type: one of no_data/unformated_data/ftp_data
 
* type: one of no_data/unformated_data/ftp_data
 
* title: string
 
* title: string
* summary: string
+
* abstract: string
 +
* owning organisation: string
 +
* authors: string
 +
* keywords: string
 
* ftp_file: one or multiple filenames (only if type is ftp_data)
 
* ftp_file: one or multiple filenames (only if type is ftp_data)
 
|REST_header_param=subjectid:SECURITY-TOKEN
 
|REST_header_param=subjectid:SECURITY-TOKEN

Revision as of 13:20, 2 May 2014

Description Create a new investigation from ISA-TAB files
Resource Investigation
Method POST
URI /investigation
Parameters optional params:
  • allowReadByUser: one or multiple userservice-URIs (User)
  • allowReadByGroup: one or multiple userservice-URIs (Organisations, Projects)
  • summarySearchable: true/false (default is false)

required params (when upload not in isa-tab format):

  • type: one of no_data/unformated_data/ftp_data
  • title: string
  • abstract: string
  • owning organisation: string
  • authors: string
  • keywords: string
  • ftp_file: one or multiple filenames (only if type is ftp_data)
Header Parameters subjectid:SECURITY-TOKEN
Media Type (input) multipart/form-data:
  • upload ISA-TAB files (isa-tab zip archive)
  • upload unformated data (zip archive, required params)
  • upload without data (ftp filename, required params)
  • upload without data (required params)
Results Task URI
Media Type (output) text/uri-list
Status code 202

cURL example

curl -Lk -X POST -i -H "subjectid:MYTOKEN" -F file="@ExampleFilename.zip;type=application/zip" \
-d "allowReadByUser=USER_URI1,USER_URI2" -d "allowReadByGroup=GROUP_URI1,GROUP_URI2" -d 'summarySearchable=VALUE' https://services.toxbank.net/investigation
curl -Lk -X POST -i -H "subjectid:MYTOKEN" -d "type=NO_DATA" -d "title=STRING" -d "summary=STRING" \
-d "allowReadByUser=USER_URI1,USER_URI2" -d "allowReadByGroup=GROUP_URI1,GROUP_URI2" -d 'summarySearchable=VALUE' https://services.toxbank.net/investigation
curl -Lk -X POST -i -H "subjectid:MYTOKEN" -F file="@ExampleFilename.zip;type=application/zip" \
-d "type=UNFORMATED_DATA" -d "title=STRING" -d "summary=STRING" -d "allowReadByUser=USER_URI1,USER_URI2" -d "allowReadByGroup=GROUP_URI1,GROUP_URI2" \
-d 'summarySearchable=VALUE' https://services.toxbank.net/investigation
curl -Lk -X POST -i -H "subjectid:MYTOKEN" -d "type=FTP_DATA" -d "ftp_file=FILE_A,FILE_B" -d "title=STRING" -d "summary=STRING" \
-d "allowReadByUser=USER_URI1,USER_URI2" -d "allowReadByGroup=GROUP_URI1,GROUP_URI2" -d 'summarySearchable=VALUE' https://services.toxbank.net/investigation
Personal tools