Aller au contenu
Livstick Développeurs

Issue a record token

Méthode POST https://<client-api-host>/api/v3.1/containers/{crid}/record-tokens

Issue a short-lived recordToken for the Livstick widget in record mode. The mrid does not need to exist: the token creates the message. A new call for the same (crid, mrid) issues a new token aiming at the same message. On a single container the role is organizer; asking for contributor answers 409 MODE_MISMATCH. A closed gallery answers 409 GALLERY_CLOSED. With hold: true the recorded video is encoded but not published until POST …/release.

Autorisation

Scope requis tokens:record

Use Authorization: Bearer liv_<prefix>_<secret>. The key must belong to a platform served by the V3 pipeline; otherwise every route answers 403 PLATFORM_NOT_V3.

Paramètres

Nom Emplacement Type Requis Contraintes Description
crid Chemin string Requis Your business reference of the container.

Corps de la requête

Requis application/json Schéma V31RecordTokenRequest

Nom Type Requis Description
mrid string Requis Contraintes pattern ^[A-Za-z0-9:_-]{1,64}$
role V31MessageRole Facultatif Valeurs organizer contributor
hold boolean Facultatif Encode the video but wait for release before publishing it. Par défaut false
sender object Facultatif
sender.firstName string Facultatif Contraintes max length 50
sender.lastName string Facultatif Contraintes max length 50
expiresIn integer Facultatif Lifetime in seconds. Par défaut 3600 Contraintes min 60, max 86400

Réponses

201 application/json Schéma V31RecordTokenResponse

Token issued.

400 application/json Schéma V31ErrorEnvelope

Invalid payload, unknown field or invalid value.

json 400
{
  "error": {
    "code": "DATA_INVALID",
    "message": "Invalid field crid"
  }
}

401 application/json Schéma V31ErrorEnvelope

Authentication failed or missing bearer token.

json 401
{
  "error": {
    "code": "UNAUTHORIZED",
    "message": "Missing API key"
  }
}

403 application/json Schéma V31ErrorEnvelope

Authenticated but not allowed: missing scope (FORBIDDEN), invalid platform constraints (INVALID_PLATFORM_CONSTRAINTS) or a platform not served by API v3.1 (PLATFORM_NOT_V3).

json 403
{
  "error": {
    "code": "PLATFORM_NOT_V3",
    "message": "Platform is not served by API v3.1"
  }
}

404 application/json Schéma V31ErrorEnvelope

Container not found for this crid on the platform of the key.

json 404
{
  "error": {
    "code": "NOT_FOUND",
    "message": "Container not found"
  }
}

409 application/json Schéma V31ErrorEnvelope

The request conflicts with the state of the container or message: CRID_IN_USE, MODE_MISMATCH, GALLERY_CLOSED, GALLERY_NOT_EMPTY, MESSAGE_REJECTED, MESSAGE_MISSING.

json 409
{
  "error": {
    "code": "GALLERY_CLOSED",
    "message": "Gallery is closed"
  }
}

429 application/json Schéma V31ErrorEnvelope

Rate limit exceeded.

json 429
{
  "error": {
    "code": "RATE_LIMITED",
    "message": "Too many requests"
  }
}

500 application/json Schéma V31ErrorEnvelope

Unexpected server error.

json 500
{
  "error": {
    "code": "INTERNAL_ERROR",
    "message": "Internal error"
  }
}