Versions Compared

Key

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

Table of Contents

To be updated

Purpose

Upload and download files in Data Manager can be done using various mechanisms : 

...

This document describes the Data Manager mechanism via the REST API method, where users can upload a PGP encrypted XML file.

...

titleColorwhite
titleBGColorred
titleImportant note on security

The examples below are for educational purposes: WMDA



Please do read https://ec.haxx.se/usingcurl-netrc.html on the use of Bearer Token if you plan to automate these procedures.

Code Block
# example use:
curl --netrc-file mycredentialsfile https://xyz.com

# the mycredentialsfile contains :
machine <xyz.com> login <johndoe@xyz.com> password <uf9873o^9ufwa>



Using the REST API

There are many ways by using different programming languages to execute API requests. WMDA provide an example by using curl for educational purpose.

To get more knowledge for usage of curl, we recommend member to read the doc for curl   https://ec.haxx.se/usingcurl-netrc.html

There are 2 steps 

Step 1: Request the credential which can be used to generate the Bear Token 

Step 2: Test to use the API in WMDA WMDA Data Manager swagger: https://brave-forest-04a379103.azurestaticapps.net/?urls.primaryName=Data%20Manager%20Data%20Exchange%20API#/

Step 3: Implement the API.

If you are already familiar with the API  implementation, then you can skip Step 2, and test from your own implementationTo test the API you may use a tool like Restlet or Postman, a plugin for Chrome browsers to test API calls before you deploy. The server responds with a HTTP code 200 in when successful, but 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

Staging system: https://stagingsan-dataupload.wmda.info

Production system: https://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 required. 
See our suggestion below in "Upload".

cX-Rename-If-Existstrue

...