Generates the URL for uploading the expense report. The report can be a PDF file or an image.
For calling the API, you will need the access token.
This generates a pre-signed URL for uploading the attachment to the AppZen environment.
Note the file_id field from the response. In the AppZen system, this is the Key/Name of your attachment.
You will need this field while uploading a report.
Request URI
GET https://api.appzen.com/expense-ingestion/reports/{{external_report_id}}/images/upload-url
Header Parameters
Name | Type | Description | Required |
---|---|---|---|
Authorization | String | The valid token to authorize the request. | Yes |
Path Parameters
Name | Type | Description | Required |
---|---|---|---|
external_report_id | String | The External report id. | Yes |
Sample Request
curl -L -X GET 'https://api.appzen.com/expense-ingestion/reports/TestAPIReport/images/upload-url' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer eyJrxxxx' \
-H 'Cookie: JSESSIONID=706102609C71A1DF432013174363574B' \
--data-raw ''
Sample Response
Success
{
"Status": "Success",
"msg": "Successfully generated URL for uploading image",
"image_upload_url_details": {
"url": "https://appzen-images.s3.amazonaws.com/100439/b229c99f-e4xxx-4a07-9f77-8e9ee1fb513a?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20221226T062738Z&X-Amz-SignedHeaders=host&X-Amz-Expires=300&X-Amz-Credential=AKIASWXSxxxxEDEM%2F20221226%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Signature=086axxxb78b44e4exxxx8efe8f7413f754debfd87b77167aa7f2",
"file_id": "b229c99f-e451-4a07-9f77-8e9ee1fb513a"
},
"external_report_id": "TestAPIReport5"
}
Failure
The request fails if you enter an invalid token.
{
"timestamp": 1672037794859,
"status": 401,
"error": "Unauthorized",
"message": "Signed JWT rejected: Invalid signature",
"path": "/reports/TestAPIReport/images/upload-url"
}
Response Code
Response Code | Description |
200 | The request is successful. |
500 | The request failed. |
See Also
Comments
Article is closed for comments.