Download the original file
curl --request GET \
--url https://app.sahlfinancial.com/api/v1/documents/{document_id}/preview \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.sahlfinancial.com/api/v1/documents/{document_id}/preview', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.sahlfinancial.com/api/v1/documents/{document_id}/preview"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)"<string>"{
"detail": "Invalid or expired token"
}{
"detail": "Insufficient permissions"
}{
"detail": "Stored file is missing"
}{
"detail": [
{
"type": "missing",
"loc": [
"body",
"bank_code"
],
"msg": "Field required",
"input": {}
}
]
}{
"code": "rate_limit_exceeded",
"message": "Too many requests. Please slow down."
}Download the original file
Who can call it: Any signed-in member of the workspace.
Streams back the file as uploaded, with its stored content type and Content-Disposition: inline. Served through the API so the workspace check applies: another workspace’s document is a 404.
Auth: dashboard session (Authorization: Bearer <access token>). Not available with a partner API key.
Download the original file
curl --request GET \
--url https://app.sahlfinancial.com/api/v1/documents/{document_id}/preview \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.sahlfinancial.com/api/v1/documents/{document_id}/preview', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.sahlfinancial.com/api/v1/documents/{document_id}/preview"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)"<string>"{
"detail": "Invalid or expired token"
}{
"detail": "Insufficient permissions"
}{
"detail": "Stored file is missing"
}{
"detail": [
{
"type": "missing",
"loc": [
"body",
"bank_code"
],
"msg": "Field required",
"input": {}
}
]
}{
"code": "rate_limit_exceeded",
"message": "Too many requests. Please slow down."
}Authorizations
The access token (JWT) of a signed-in console user, from POST /v1/auth/login. It lasts 30 minutes. It is not an API key: a partner API key is refused here. There is no cookie.
Path Parameters
Response
The file, with its stored content type.
The response is of type file.