Get an Attachment File Associated with an Expense Report

GET /expense-reports​/{id}​/attachments/{attachment_id}/download — Use this method to retrieve the file associated with the attachment record with the specified attachment ID associated with the expense report with the specified internal ID.

Parameters

Path parameters

Path parameter

Required / Optional

Description

Type

{id}

Required

The internal ID of the expense report.

integer

{attachment_id}

Required

The internal ID of the attachment.

integer

Query string parameter

Path parameter

Required / Optional

Description

Type

filterSetId

Optional

The internal ID of the filter set to be applied.

  • When specified, the request is successful only if the action is available when the specified filter set is active in OpenAir. The filter set with the specified internal ID must exist and must be associated with the user who authorized the application as per the access token.

  • Otherwise and by default, the primary filter set associated with the user who authorized the application is applied.

integer

Response definitions

A successful or failed request returns a JSON object with the following properties:

Property

Description

message

A string containing a brief message about the status of your request — e.g. “Success” or “Attachment #598 not found”.

A successful request also returns the attachment file.

Sample request

            GET expense-reports​/237/attachments/4982/download HTTP/1.1
Host: company-id.app.openair.com
Authorization: Bearer <OAuth2_access_token> 

          

In the example, <OAuth2_access_token> is the OAuth 2.0 access token obtained for the client application connecting to OpenAir. See Authentication.

Sample response

The attachment file.