Get an attachment

Get a document that is attached to a BILL object. With /GetDocumentPages.json, you can retrieve documents attached to bills and vendor credits.

Note: Currently, /GetDocumentPages.json does not support retrieving documents attached to an AR invoice.

In your request, set id as the BILL object ID. For example, set id as the bill ID for retrieving a document that is attached to the bill.

BILL object without an attachment

In the response, fileUrl is set as null.

BILL object with a single text attachment

In the response, a fileUrl value is generated, which includes an id. Use the returned id in a subsequent GET request for downloading the text attachment. Note that the attachment must be in the .txt format.

curl --request GET 'https://api-stage.bill.com/HtmlServlet?id={fileUrl_id}'
--header 'sessionId: {session_id}'

BILL object with a multi-page attachment

In the response, a fileUrl is generated and numPages is the number of pages in the attachment. Use the returned id in a subsequent GET request for downloading the attachment. For a single-page attachment, set pageNumber as 1 in your GET request.

curl –-request GET 'https://api-stage.bill.com/is/BillImageServlet?entityId={fileUrl_id}&pageNumber={page_number}'
--header 'sessionId: {session_id}'

Note: Documents are downloaded in the PNG format.

Language
Click Try It! to start a request and see the response here!