Versions Compared

Key

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

...

Code Block
titleData Manager API file upload
curl 'https://sandbox-datamanager-api.wmda.info/api/v1/files/upload' \
--header 'Authorization: Bearer ••••••' \
--header 'Content-Type: multipart/form-data' \
--form 'file=@/path/to/file/ION-0999-D.gpg' \
--form 'ion="9999"' \
--form 'folder="upload"'


Something to be aware of for windows based cmd:

  1. please use double quote instead single quote for the request.
  2.  Line break "\" dose not work, so use the curl script in one line, or use specific break that works for your script.
  3. Use "\" to escape the double quote for the value.
  4. The path separator for the file dose not matter, both Linux used "/" and windows used  "\" works.
Code Block
titleData Manager API file upload windows
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.

...

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.