⚠Due to planned maintenance you will experience short (<30 min) downtime between 08:00 - 08:30 CET.
...
- Send email to support@wmda.info with a PGP/GPG public key. Or if you have other secure way to communicate the credential, please identify that in the email. Below we provide guide how can you generate PGP public key
- WMDA will provide you the credential and send email to notify you.
- You test the credential is working and can call call endpoint in sandbox system. You can follow the steps below to "Implemented to Generate at "Implementation of Generating Bear Token" and "Using the REST API" to test the credential:
- Implement the credential.
- Refresh Bear upload user guide below.
...
Expand | ||
---|---|---|
| ||
After install Kleppatra, follow steps below:
|
...
Implementation of Generating Bear Token
Data Manager uses Bear Token for the authorization as all WMDA API services, please follow user guide for API authentication to implement https://share.wmda.info/x/8I7RFw.
...
Step 1: Set up the credential by following the instruction above in the "Implement credentialImplementation of Generating Bear Token"
Step 2: Test to use the API in WMDA Data Manager sandbox.
Below is an example to guide how to get the information to upload a file:
URL | |
---|---|
SERVER URL | Sandbox system: https://sandbox-datamanager-api.wmda.info Production system: https://datamanager-api.wmda.info (Only process the file after get clean notification from WMDA) |
URI | /api/v1/ions/list |
METHOD | POST |
Full URL path example | https://sandbox-datamanager-api.wmda.info/api/v1/ions/list |
Request body | no request body needed |
HEADER | Authorization and Content-Type are required, the other ones are optional |
Authorization | Bear Token |
Content-Type | application/json |
...
Run curl call as below to get the ion(s) you have access. You may get one or multiple ions based on your access permission.
"-i" option can be used to check the detail details of the communication if something go wrong.
...
Code Block | ||
---|---|---|
| ||
curl 'https://sandbox-datamanager-api.wmda.info/api/v1/files/upload' \ --header 'Authorization: Bearer ••••••' \ --header 'Content-Type: multipart/form-data' \ --form 'file=@c:@/path/to/file/ION-0999-D.gpg' \ --form 'ion="9999"' \ --form 'folder="upload"' |
Something to be aware of for windows based cmd:
- please use double quote instead single quote for the request.
- Line break "\" dose not work, so use the curl script in one line, or use specific break that works for your script.
- Use "\" to escape the double quote for the value.
- The path separator for the file dose not matter, both Linux used "/" and windows used "\" works.
Code Block | ||
---|---|---|
| ||
curl "https://sandbox-datamanager-api.wmda.info/api/v1/files/upload" --header "Authorization: Bearer ••••••" --header "Content-Type: multipart/form-data" --form "file=@C:/path/to/file/ION-0999-D.gpg" --form "ion=\"9999\"" --form "folder=\"upload\"" |
Download
Download reports
You may use the API to fetch your reports . And 2 steps are needed.
For windows based cmd syntax, please see the example in the "Upload" part.
1.Fetch the files list and get the file names.
...
Code Block | ||
---|---|---|
| ||
curl https://sandbox-datamanager-api.wmda.info/api/v1/files/download \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer ••••••' \
--data '{
"ion": 9999,
"folder": "report",
"fileName": "<filename>.txt"
}' \
--output <filename>.txt |
Download full dataset
For those registries that are permitted to use the full dataset the statement below will fetch that. You can download the file in the folder "download"
Code Block | ||
---|---|---|
| ||
curl https://sandbox-datamanager-api.wmda.info/api/v1/files/download \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer ••••••' \
--data '{
"ion": 9999,
"folder": "download",
"fileName": "wmda_data_v22.zip.gpg"
} \
--output wmda_data_v22.zip.gpg |
Guide for troubleshooting of API usage
Q: I get 401 error when using endpoint?
A: This means you do not have access to the endpoint or you did no provide the token correctly. Please double check whether you have extra space or miss space for the parameter "Authorization: Bearer <token>". And if you confirm that and still get 401, please contact support@wmda.info.
Q: I see 403 error for endpoint upload/download, what is next step?
A: If you can call the endpoint of ions/list, and then get 403 error for upload/download, most possible is because the request body is invalid. Please double check whether any single or double quote or options are wrongly used.