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_embed

Required parameters

ParameterRequiredDescription
company_uuidtrueCompany UUID. Take it from the Companies response — the external_uuid field
signaturetrueHMAC-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.

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=d41d8cd98f00b204e9800998ecf8427e

Next, add parameters and add the iframe to your product.

Search…

Start typing to search