Public download key
We'll assume you've already got the API authentication settled and you have our API token with you.
Create public download key #
Public download key is used to generate download URL and perform download. You can create public download key using earlier created download id(in this example we will use 6d3bf21d-0e10-4484-af02-81e94ff9606b) and user temporary key. To create public download key make POST
request to the /api/downloads/6d3bf21d-0e10-4484-af02-81e94ff9606b/keys
endpoint.
curl -X POST https://privasfer.com/api/downloads/6d3bf21d-0e10-4484-af02-81e94ff9606b/keys \
-H 'Authorization: Bearer 7xcB5XlinBWGzajPdSW7bHr12erWZICIJN4jk0RpasoLYLpoiD6ErYnVSzld' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-d '{"pinKey":"FLJevKp6lzyigDQVCB3TReB1mK8iePRZ"}'
Form fields #
name | description | type |
pinKey | User temporary key. You can read more here. | string |
If the API call succeeded, you'll be given output like this.
{
"data": {
"key": "5iyEs1S43E21LZHDEsVKAJK9XJcZlxJL"
}
}
Return properties #
- key: download key
Error handling #
If an error occurred, you'll be given a non-HTTP/200 response code. The resulting payload might look like this.
{
"message": "The given data was invalid.",
"errors": {
"pinKey": [
"Pin key does not exists"
]
}
}