Build URL and signature
Required chat UI URL parameters and HMAC-SHA512 signature generation
Every chat UI URL starts with the base path and two required query parameters.
text
https://msg.pact.im/pact_embedRequired parameters
| Parameter | Required | Description |
|---|---|---|
| company_uuid | true | Company UUID. Take it from the Companies response — the external_uuid field |
| signature | true | HMAC-SHA512 signature used for authentication |
How to build signature
Compute HMAC-SHA512 over the JSON string {"company_uuid":"YOUR_COMPANY_UUID"}, using your private_api_token (the same token you use for the API) as the key.
Note
The signed string must match that JSON literally: the
company_uuid key and your company’s UUID value.js
const crypto = require("crypto")
const privateApiToken = "YOUR_API_TOKEN"
const companyUuid = '{"company_uuid":"YOUR_COMPANY_UUID"}'
const signature = crypto
.createHmac("sha512", privateApiToken)
.update(companyUuid)
.digest("hex")
console.log(signature)Example URL
text
https://msg.pact.im/pact_embed?company_uuid=1234a567-2d3a-4dfd-b021-489ead21b830&signature=d41d8cd98f00b204e9800998ecf8427eNext, add parameters and add the iframe to your product.