API
API documentation: https://api.kameleon.app
Application user
In order to call Kameleon API application need’s to be created and configured in Microsoft Entra and added to access control list in Kameleon Portal.
Entra
Register application in Entra
https://learn.microsoft.com/en-us/entra/identity-platform/quickstart-register-app
Copy Application (client) id
Kameleon
Configure created Entra application as application for Kameleon
Navigate to Kameleon Portal > Users > Applications
Add new application with Application (client) id
Application name is only used as human readable name in Kameleon Portal, and it doesn’t have to match name in Entra
API usage
Example: Create document
To create document user needs to call document/create
endpoint. This endpoint requires following information
Document id unique identifier for Kameleon document
Author
Company id unique identifier for company defined in Kameleon Portal. Used e.g. to select correct logo for document
Unit id unique identifier for company unit. Used e.g. to select document footer and provide address information for document
Properties key value pairs for document fields. e.g.
{ title: 'Offer' }
Node.js + TypeScript
This example uses client secret to acquire access token for Kameleon API call.
Kameleon API requires scope api://e95a233a-a13e-4c5d-99b9-51832e41e036/.default
import { ClientSecretCredential } from "@azure/identity";
const credential = new ClientSecretCredential(tenantId, clientId, clientSecret)
const accessToken = await credential.getToken('api://e95a233a-a13e-4c5d-99b9-51832e41e036/.default')
const response = await fetch('https://api.kameleon.app/v1.0/document/create', {
headers: {
'Content-Type': 'application/json',
'Authorization': `${accessToken.tokenType} ${accessToken.token}`
},
method: 'POST',
body: JSON.stringify({
documentId: '86158325-b8d5-4415-8e58-50c71e49c07f',
author: {
name: 'John Doe',
companyId: '0ab26d5d-7d54-4dec-8208-dfb03502cc5b',
unitId: 'b416ca10-595f-4445-bf0b-f63dd2cf78c0'
},
properties: {}
})
})