Receipts
Get Upload URL
This endpoint provides a presigned url where an image or file can be uploaded.
GET
/upload_url
Bearer*
curl --request GET \
--url https://api.thanx.com/upload_url \
--header 'Authorization: Bearer <token>' \
--data '{
"upload_type": "<upload_type>"
}'
In order to submit a receipt to Thanx, you must first make a request to the API to get a presigned upload URL. Once you have uploaded the image to this URL, make a POST /receipts
request to create the receipt in Thanx.
The file_path
can be used as the input to the POST /receipts
endpoint.
Parameters
upload_typerequired
enum
The type of upload; currently only option is (receipt
)
Response
url
string
Url to upload the image to
file_path
string
Path where the image will be saved
{
"upload_url": {
"url": "https://thanx.s3.amazonaws.com/uploads/receipts/image_5051555_1534872299.jpeg?AWS-PARAMS",
"file_path": "uploads/receipts/image_5051555_1534872299.jpeg"
}
}
curl --request GET \
--url https://api.thanx.com/upload_url \
--header 'Authorization: Bearer <token>' \
--data '{
"upload_type": "<upload_type>"
}'
{
"upload_url": {
"url": "https://thanx.s3.amazonaws.com/uploads/receipts/image_5051555_1534872299.jpeg?AWS-PARAMS",
"file_path": "uploads/receipts/image_5051555_1534872299.jpeg"
}
}