Download file of an invoice
Downloads file of an invoice.
Endpoint
GET /integration/invoice/{id}/file
HTTP Request
GET /integration/invoice/{id}/file
Query parameters
| Name | Description | Required | Type |
|---|---|---|---|
| id | Identifier of the invoice | Yes | string |
Successful response, binary content
HTTP 200
Erroneous response
HTTP 404
{
"code": "404",
"reason": "Invoice not found."
}
Responses
| Code | Description |
|---|---|
| 200 | Successful operation |
| 400 | Invalid request |
| 401 | Unauthorized |
| 404 | Not found |
| 500 | Unexpected error |
Examples
curl https://api.bluetape.com/genericBthubService/integration/invoice/<invoiceId>/file \
-H "X-BlueTape-Key: <your-key>" \
-H "X-Integration-AccountId: <your-account-id>" \
import fetch from 'node-fetch';
const invoiceId = 'b22c7fadc506';
const url = `https://api.bluetape.com/genericBthubService/integration/invoice/${invoiceId}/file`;
const options = {
method: 'GET',
headers: {
'X-BlueTape-Key': '<your-key>',
'X-Integration-AccountId': '<your-account-id>',
'Content-Type': 'application/pdf'
}
};
fetch(url, options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
using Flurl.Http;
var invoiceId = "b22c7fadc506";
var url = $"https://api.bluetape.com/genericBthubService/integration/invoice/{invoiceId}/file";
var resultStream = await url
.WithHeader("X-BlueTape-Key", "<your-key>")
.WithHeader("X-Integration-AccountId", "<your-account-id>")
.WithHeader("Content-Type", "application/pdf")
.GetStreamAsync();
import requests
invoiceId = "b22c7fadc506"
url = f'https://api.bluetape.com/genericBthubService/integration/invoice/{invoiceId}/file'
headers = {
"X-BlueTape-Key": "<your-key>",
"X-Integration-AccountId": "<your-account-id>",
"Content-Type": "application/pdf"
}
response = requests.get(url, headers=headers, allow_redirects=True)
open('filename.pdf', 'wb').write(r.content)