...
URL | |
---|---|
SERVER URL | https://staging-dataupload.wmda.info |
URI | /api/v2/io/ION1234/ Explanations:
|
METHOD | PUT |
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. |
XcX-Rename-If-Exists | true |
- Server name should be https://staging-dataupload.wmda.info
- For production you will need https://dataupload.wmda.info
...
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 | ||
---|---|---|
| ||
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. |
Code Block | ||
---|---|---|
| ||
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 | ||
---|---|---|
| ||
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" |
...