post https://api-stage.bill.com/api/v2/GetDocuments.json
Get a document attached to a bill. In your request, set id
as the bill ID. The value begins with 00n
.
In the response, a fileUrl
value is generated, which includes an id
. Use the returned id
in a subsequent GET request for downloading the bill attachment. Set --output
as a file name and extension. For example, bill-attachment.pdf
.
Note: Set the correct file extension in your GET request. For example, you cannot download a PNG file as a PDF.
curl 'https://api-stage.bill.com/DownloadBillDocumentServlet?id={fileUrl_id}&billId={bill_id}' \
--output {file_name} \
--header 'sessionId: {session_id}'