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/octet-stream (when your file < 128K)

multipart/form-data (when your file >128K)

From  , Content-Type is necessaryrequired, we suggest to use it together with binary object. 
See example below.

cX-Rename-If-Existstrue

...

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. We noticed that the uploaded file format can be binary or with info to identify it is PGP/GPG MESSAGE. And for PGP/GPG MESSAGE format, there are more solutions.

Suggestion 1:
For all the files, script as below is suggested for file larger than 128K. 

Code Block
titleCurl for linux
curl -i -X PUT -H "Authorization:Basic d21.....uZT==" -H "Content-Type: applicationmultipart/octetform-streamdata" --data-binary "@/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: applicationmultipart/octetform-streamdata" --data-binary "@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"

...


Suggestion 2:

For files that identified as PGPG/GOG MESSAGE (open the file can see this info), then -F and -H options also work. -F already included "Content-Type: multipart/form-data", so no need to provide it any more.

Code Block
titleCurl for linux
curl -i -X PUT -H "Authorization:Basic d21.....uZT==" -F "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 linux
curl -i -X PUT -H "Authorization:Basic d21.....uZT==" -F "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"

FAQ


Question : My report states : File could not be processed due to a file decryption error, when using the API

...