Overview

This documentation covers how to generate tokens required for embedding Vocera agents in your website or application.

Base URL

https://new-prod.vocera.ai

Authentication Endpoint

Generate Agent Embed Token

POST /user/v1/embedded/login/

This endpoint generates access and refresh tokens needed for embedding an agent in your application.

Request Headers

HeaderDescription
Content-Typeapplication/json

Request Body

{

    "api_key": "YOUR_API_KEY",

    "agent_id": 1

}

Parameters

  • api_key (string, required): Your unique API key for authentication
  • agent_id (integer, required): The unique identifier of the agent you want to embed

Response

A successful request will return both refresh and access tokens required for agent embedding.

Success Response Example

{

    "refresh": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",

    "access": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."

}

Response Fields

  • refresh (string): JWT refresh token used to obtain new access tokens when they expire
  • access (string): JWT access token used for embedding the agent

Error Responses

Status CodeDescription
400Invalid request parameters
401Invalid or missing API key
403Unauthorized access
500Internal server error

Implementation Steps

  1. Obtain your API key from the Vocera dashboard
  2. Make a POST request to the token generation endpoint
  3. Store both the access and refresh tokens securely
  4. Use these tokens when implementing the agent embed widget
  5. Implement token refresh logic to maintain continuous agent functionality

Token Usage

  • The access token is required when initializing the agent embed widget
  • Access tokens expire after 24 hours (1 day)
  • Access tokens have a limited lifetime and will need to be refreshed
  • Use the refresh token to obtain new access tokens when they expire

Security Considerations

  • Store your API key securely
  • Use HTTPS for all API calls
  • Never expose your API key or tokens in client-side code
  • Implement proper error handling for failed token generation
  • Store tokens securely and clear them when removing the agent embed