Session Managment With Rest
Manage sessions with REST APIs for interactive avatar control. This guide covers session creation, control, and automatic termination.
1. Create Session
To begin a session:
Use Your API Key:
Make an API request to create a session using your API key.
Response: The API will return a session token, which is essential for managing the session.
Example Request:
Example Response:
2. Sending the Session Token to Frontend
Once you have the session token:
Transmit the Session Token: Send the session token to your frontend application.
Integrate with Web SDK: The frontend will use this token with the Web SDK to interact with the session.
3. Sending the Session Token to Frontend
To control the avatar’s speech or actions:
Send Commands via API:
Use the session token to issue commands, like making the avatar speak.
The avatar will respond only when the session is active.
Example Request:
Example Response:
4. Terminating the session
To end a session:
Automatic Termination:
Sessions are automatically terminated after a specified period of inactivity (set by your configuration).
Manual Termination:
You can manually terminate a session using the API.
Example Request:
Example Response:
Last updated