...
Panel | ||||||
---|---|---|---|---|---|---|
| ||||||
The examples below are for educationall purposes: Please do read https://ec.haxx.se/usingcurl-netrc.html on the use of passwords and usernames if you plan to automate these procedures.
|
Using the REST API
To test the API you may use a tool like Restlet, a plugin for Chrome browsers to test API calls before you deploy. The server responds with a HTTP code 200 in when succesfull, but may the response body may contain detailed error messages.
In case the upload succeeded, an XML response with meta information of the upload is generated. You may use this for own logging purposes. For more info you can read the full API specification
URL |
---|
SERVER URL | https://staging-dataupload.wmda.info |
URI | /api/v2/io/ION0999/ Please refer to the file naming convention. This is stated as : For XML format:The files are marked with ION numbers ( ION-1234-D or ION-1234-C) The ION number is an unique number of an organisation sending the file. The D give the information that it is a donor file and the C give the information that it is a cord blood file |
METHOD | PUT |
HEADER | only Authorization is required, the other ones are optional |
Authorization | basic |
Content-Type | application/x-www-form-urlencoded |
X-Rename-If-Exists | true |
- Server name should be https://staging-dataupload.wmda.info
- For production you will need https://dataupload.wmda.info
...
- Look carefully at the path : here we use ion0999, that should be replaced by your ION.
- You may notice that we add the filename to the path: depending on the library you may need to add that
Upload
Now we know the path is correct and we can do an upload using cURL:
Code Block |
---|
curl -i -X PUT -H "Authorization:Basic d21.....uZT==" -T "./test.pgp" 'https://staging-dataupload.wmda.info/api/v2/io/ION0999/' |
Download
You may use the API also to fetch your reports : Use the following endpoint to fetch an array with filedescriptors:
Code Block |
---|
https://staging-dataupload.wmda.info/api/v2/fs/reports-ion0999/?children=f |
...
In RESTLET :
Click on Code to get raw CURL syntax:
Response should be 200:
Download full dataset
For those registries that are permitted to use the full dataset the statement below will fetch that. Please change the ION workspace to match your ION.
Code Block |
---|
curl -O GET -H "Authorization:Basic .............." 'https://dataupload.wmda.info/api/v2/io/downloads/ION1804/bmdw4data.zip.gpg' -o 'bmdw4data.zip.gpg' |
...