Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

URL
SERVER URLhttps://staging-dataupload.wmda.info
URI

/api/v2/io/ION1234/

Explanations: 

  • 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 the unique ION 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
METHODPUT
Full URL path example

For donor for organization with ION-1234, the full path is as below:

https://staging-dataupload.wmda.info/api/v2/io/ION1234/ION-1234-D.gpg

HEADER

Authorization and Content-Type are required, the other ones are optional

Authorization

basic

Content-Type

application/x-www-form-urlencodedoctet-stream

From  , we suggest for upload, use -F (--form) combine which will by default have a Content-Type multipart/form-data, and can provide the file path.is necessary, we suggest to use it together with binary object. 
See example below.

XcX-Rename-If-Existstrue

...

Now we know the path is correct and we can do an upload using cURL: 

This is a old way Below is the invalid to deploy, currently it is still available in production PRODUCTION till production maintenance before Nov, 7th, 2023. But not available any more in staging STAGING dataupload. 

Code Block
titleOld curl for linuxInvalid after update from Oct, 27, 2022
curl -i -X PUT -H "Authorization:Basic d21.....uZT=="   -T "./test.pgp"  'https://staging-dataupload.wmda.info/api/v2/io/ION0999/'


Below are suggested:suggestions with more secure headers:

Warning

The curl script needs update to upload in STAGING from Oct, 27th, 2022 after maintenance/update .  And the new suggested script can be used in PRODUCTION as well. So we strongly suggest API users to update, then there will be less stress after PRODUCTION update/maintenance.  
For registries use other script, please test in STAGING as well, and adjust with the Content-Type if not used before.

Code Block
titleCurl for linux
curl -i -X PUT -H "Authorization:Basic d21.....uZT==" -H "Content-Type: application/octet-stream" --Fdata-binary "file=@/path/to/file/ION-0999-D.gpg"  "https://staging-dataupload.wmda.info/api/v2/io/ION0999/" -H "X-File-Name:ION-0999-D.gpg"

...

Code Block
titleCurl for windows
curl -i -X PUT -H "Authorization:Basic d21.....uZT==" -H "Content-Type: -Fapplication/octet-stream" --data-binary "file=@c:/path/to/file/ION-0999-D.gpg"  "https://staging-dataupload.wmda.info/api/v2/io/ION0999/" -H "X-File-Name:ION-0999-D.gpg"

...