API Investigation:Create

From ToxBank API Wiki
(Difference between revisions)
Jump to: navigation, search
(define upload params for non isa-tab formated data)
Line 9: Line 9:
 
* summarySearchable: true/false (default is false)
 
* summarySearchable: true/false (default is false)
 
required params (when upload not in isa-tab format):
 
required params (when upload not in isa-tab format):
* type: one of no_data/unformated_data/ftp_data
+
* type: one of noData/unFormatedData/ftpData
 
* title: string
 
* title: string
 
* abstract: string
 
* abstract: string
* owning organisation: URI
+
* owning organisation: URI/URIs
 
* authors: string
 
* authors: string
 
* keywords: 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 ftpData)
 
|REST_header_param=subjectid:SECURITY-TOKEN
 
|REST_header_param=subjectid:SECURITY-TOKEN
 
|REST_op_mime_input=multipart/form-data:
 
|REST_op_mime_input=multipart/form-data:
Line 30: Line 30:
 
  -d "allowReadByUser=USER_URI1,USER_URI2" -d "allowReadByGroup=GROUP_URI1,GROUP_URI2" -d 'summarySearchable=VALUE' https://services.toxbank.net/investigation
 
  -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" \
+
  curl -Lk -X POST -i -H "subjectid:MYTOKEN" -d "type=noData" -d "title=STRING" -d "abstract=STRING" -d "owningOrganisation=[URI,URI]" \  
  -d "allowReadByUser=USER_URI1,USER_URI2" -d "allowReadByGroup=GROUP_URI1,GROUP_URI2" -d 'summarySearchable=VALUE' https://services.toxbank.net/investigation
+
  -d "authors=[STRING,STRING]" -d "keywords=[STRING,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" \
 
  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 "type=unFormatedData" -d "title=STRING" -d "abstract=STRING" -d "owningOrganisation=[URI,URI]" -d "authors=[STRING,STRING]" -d "keywords=[STRING,STRING]" \
-d 'summarySearchable=VALUE' https://services.toxbank.net/investigation
+
-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" \
+
  curl -Lk -X POST -i -H "subjectid:MYTOKEN" -d "type=ftpData" -d "title=STRING" -d "abstract=STRING" -d "owningOrganisation=[URI,URI]" \
  -d "allowReadByUser=USER_URI1,USER_URI2" -d "allowReadByGroup=GROUP_URI1,GROUP_URI2" -d 'summarySearchable=VALUE' https://services.toxbank.net/investigation
+
  -d "authors=[STRING,STRING]" -d "keywords=[STRING,STRING]" -d "ftpFile=[FILENAME_A,FILENAME_B]" -d "allowReadByUser=USER_URI1,USER_URI2" \
 +
-d "allowReadByGroup=GROUP_URI1,GROUP_URI2" -d 'summarySearchable=VALUE' https://services.toxbank.net/investigation

Revision as of 07:40, 5 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 noData/unFormatedData/ftpData
  • title: string
  • abstract: string
  • owning organisation: URI/URIs
  • authors: string
  • keywords: string
  • ftp file: one or multiple filenames (only if type is ftpData)
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=noData" -d "title=STRING" -d "abstract=STRING" -d "owningOrganisation=[URI,URI]" \ 
-d "authors=[STRING,STRING]" -d "keywords=[STRING,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=unFormatedData" -d "title=STRING" -d "abstract=STRING" -d "owningOrganisation=[URI,URI]" -d "authors=[STRING,STRING]" -d "keywords=[STRING,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=ftpData" -d "title=STRING" -d "abstract=STRING" -d "owningOrganisation=[URI,URI]" \
-d "authors=[STRING,STRING]" -d "keywords=[STRING,STRING]" -d "ftpFile=[FILENAME_A,FILENAME_B]" -d "allowReadByUser=USER_URI1,USER_URI2" \
-d "allowReadByGroup=GROUP_URI1,GROUP_URI2" -d 'summarySearchable=VALUE' https://services.toxbank.net/investigation
Personal tools