Authorization
Get an access token
Mint an 8-hour access token from the visitor's 2-year identity token (or a new visitor).
Call again when the access token expires or a request returns 401.
host_origin is the origin of the website the chat runs on. It must be an http(s) origin on the organization's allowed_domains (exact host or subdomain), else 403; the browser's Origin header must be the widget frame origin. The access token remembers host_origin; WS tickets are refused once that domain is removed.
A valid identity token for this organization returns the same customer and the same identity token (its expiry does not slide); a missing, unknown, expired or other-organization one mints a new customer and identity token. Rate limits: 10/min per IP, plus the 300/min per-IP limit of every /customer route.
POST/v1/customer/token
Specifics
| Method URL | POST https://app.staging.mlive.chat/v1/customer/token |
|---|---|
| Who can call it | Anyone. No token needed. |
| Rate limit | 10/min per IP, plus the 300/min per-IP limit of every /customer route. |
Request body
application/json
organization_idstring (uuid)requiredhost_originstring (uri)requiredtokenstring or nullThe stored identity token (mlcv_…), if any.
Response
200 · application/json
OK.
tokenstringrequiredAccess token mlcc_…, 8 hours; send as Authorization: Bearer.expires_atstring (date-time)requiredidentity_tokenstringrequiredidentity_expires_atstring (date-time)requiredcustomer_idstring (uuid)required
Errors
- 400
validation: The request is malformed or a field is invalid. Unknown fields are refused too. - 403
forbidden: This caller may not do this. - 404
not_found: Not found, or not visible to this caller. A record in another organization is always not found. - 429
rate_limited: Too many requests. Wait the number of seconds in the Retry-After header.
Nothing found. Try a method name, such as send event.