Skip to main content

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

NameDescriptionRequiredType
idIdentifier of the invoiceYesstring

Successful response, binary content

HTTP 200

Erroneous response

HTTP 404

{
"code": "404",
"reason": "Invoice not found."
}

Responses

CodeDescription
200Successful operation
400Invalid request
401Unauthorized
404Not found
500Unexpected 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)