Get a document

Get a document that is attached to a BILL object. You can retrieve documents attached to different BILL objects - bill, vendor, customer, vendor credit, bill payment, invoice payment, or chart of accounts.

Note: Currently, /GetDocumentPages.json does not support retrieving documents attached to an 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 an attachment

In the response, a fileUrl is generated and numPages returns 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-sandbox.bill.com/is/BillImageServlet?entityId={fileUrl_id}&sessionId={sessionId}&pageNumber={page_number}’

Note that documents are downloaded in the PNG format.

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