Retrieve a document

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

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

Bill.com object without an attachment

In the response, fileUrl is set as null.

Bill.com object with a single-page attachment

In the response, a fileUrl is generated. You can use the returned ID in a subsequent GET request for downloading the attachment.

curl –request GET ‘https://api-sandbox.bill.com/HtmlServlet?id={fileUrl_id}&sessionId={sessionId}’

Bill.com object with a multi-page attachment

In the response, a fileUrl is generated and numPages returns the number of pages in the attachment. You can use the returned ID in a subsequent GET request for downloading a specific page of the attachment.

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!