GetContractToPdf
Base Endpoint:
GET https://api.vlenseg.com/api/BusinessRequest/GetContractToPdf?id={id}
Overview: This endpoint allows admin to download a contract as a PDF by providing the request ID. The response content is in PDF format.
Headers:
ApiKey (required): The API key for authenticating the request.
TenancyName (required): The tenancy name that identifies the tenant.
Authorization (required): Bearer token for user authentication, obtained from the Login API.
Content-Type:
application/pdf
This endpoint allows admin to download the contract PDF by providing the contract ID.
Authorizations
Query parameters
idstringRequired
The unique contract ID to download the PDF
Header parameters
ApiKeystringRequired
TenancyNamestringRequired
AuthorizationstringRequiredExample:
Bearer <access_token>Responses
200
Successfully retrieved the contract PDF
application/pdf
Responsestring · binary
400
Bad request, missing or invalid fields
401
Unauthorized, invalid credentials
get
/api/BusinessRequest/GetContractToPdfGET /api/BusinessRequest/GetContractToPdf?id=text HTTP/1.1
Host:
Authorization: Bearer <access_token>
ApiKey: text
TenancyName: text
Accept: */*
binaryconst axios = require('axios');
const fs = require('fs');
const url = 'https://api.vlenseg.com/api/BusinessRequest/GetContractToPdf';
const params = {
id: '1e83a2e5-3d89-4b30-aa29-21e6171dd388' // Replace with the actual contract ID
};
const headers = {
'ApiKey': 'xxx', // Replace with your actual API key
'TenancyName': 'Test', // Replace with your tenancy name
'Authorization': 'Bearer <access_token>', // Replace <access_token> with the token returned from the login API
'Content-Type': 'application/pdf'
};
axios.get(url, { headers, params, responseType: 'arraybuffer' })
.then(response => {
fs.writeFileSync('contract.pdf', response.data);
console.log('PDF saved as "contract.pdf"');
})
.catch(error => {
console.error(`Error: ${error.response.status}`, error.response.data);
});
import requests
url = "https://api.vlenseg.com/api/BusinessRequest/GetContractToPdf"
params = {
"id": "1e83a2e5-3d89-4b30-aa29-21e6171dd388" # Replace with the actual contract ID
}
headers = {
"ApiKey": "xxx", # Replace with your actual API key
"TenancyName": "Test", # Replace with your tenancy name
"Authorization": "Bearer <access_token>", # Replace <access_token> with the token returned from the login API
"Content-Type": "application/pdf"
}
response = requests.get(url, params=params, headers=headers)
if response.status_code == 200:
with open("contract.pdf", "wb") as f:
f.write(response.content)
print("PDF saved as 'contract.pdf'")
else:
print(f"Error: {response.status_code}, {response.text}")
curl -X GET "https://api.vlenseg.com/api/BusinessRequest/GetContractToPdf?id=1e83a2e5-3d89-4b30-aa29-21e6171dd388" \
-H "ApiKey: xxx" \ # Replace with your actual API key
-H "TenancyName: Test" \ # Replace with your tenancy name
-H "Authorization: Bearer <access_token>" \ # Replace <access_token> with the token returned from the login API
-H "Content-Type: application/pdf" \
--output contract.pdfLast updated