Image/File · Standard API · eKYC Core
Download file
GET/v1/files/{file_id}
Retrieves an original uploaded file — video, audio or PDF — by its file_id, as raw binary or as base64.
Request
{file_id} is the id returned by Upload video/audio/frames. To get the file as base64 instead of binary, send this header:
| Header | Type | Required | Description |
|---|---|---|---|
X-DOWNLOAD-BASE64 | bool | Optional | specify flag true if need base64 content like data:video/mp4;base64,iVBORw0KGgoAAAANSU... |
Sample request
curl -X GET \
https://tv-staging.trustingsocial.com/api/v1/files/7db00808-0416-45cf-a5cb-3b6dfbd7bb74 \
-H 'Authorization: TV <YOUR ACCESS KEY>:<CREATED SIGNATURE>' \
-H 'X-TV-Timestamp: 2019-04-21T18:00:15+07:00' \
-H 'Content-Type: application/json'
Response
On success the HTTP status code is 200 and the body is the file as binary content. Only an error answers in JSON:
{
"data": {},
"errors": [
{
"code": string,
"message": string,
"detail": {
"field": string, // optional, which parameter is invalid.
... // any other information that can be useful for client
},
},
... // other errors
]
}
Failure codes
In case of error, the data will be empty, and server sends following HTTP status code and error information:
| HTTP code | Error code | Description |
|---|---|---|
401 | access_denied_exception | You are not authorized to perform the action. |
400 | invalid_parameter_exception | Input parameter violates a constraint. |
400 | request_time_too_skewed | The X-TV-Timestamp header is expired, need a newer one. |
404 | image_not_found_exception | The image ID is not found in DB. |
408 | request_timeout_exception | Request takes too long to process |
429 | rate_limit_exception | The number of requests exceeded your throughput limit. |
500 | internal_server_error | Some unexpected error occurs while processing the request |
The codes above are the ones documented for this endpoint. Response errors on the Overview lists the codes for the eKYC Core surface as a whole — the two lists do not match on every endpoint.