Migrating Video REST API from OpenTok to Unified Migrating Video REST API from OpenTok to Unified

Migrating Video REST API from OpenTok to Unified

Yukari Dumburs

Objective

If you are using the REST API, there are important differences between the OpenTok environment and the Unified environment. Both the authentication method and the request URL have changed.

Applies To

  • Video API
  • Migrate from OpenTok to Unified
  • REST API

Procedure

1. Update how you generate and use JSON Web Tokens (JWT). The required credentials, signing algorithm, and header format are different:

  OpenTok Unified
Credentials Project Key and Project Secret Application ID and Private Key
Algorithm HS256 RS256
Header sent in X-OPENTOK-AUTH sent as a Bearer token in the Authorization header
Example Payloads
{
  "iss": "your_api_key",
  "ist": "project",
  "iat": 1692268800,
  "exp": 1692269100,
  "jti": "jwt_nonce"
}
{
 "iat": 1692268800,
 "exp": 1692269100,
 "application_id": "your_application_id",
 "jti": "jwt_nonce"
}

You do not need to configure ACLs in JWT for the Video API.

Token Expiration Maximum 5 minutes (default 5 minutes) Maximum 24 hours (default 15 minutes)
Developer Guide OpenTok Developer Guide Unified Developer Guide

2. Change the base URL used for REST API requests:

  • OpenTok: https://api.opentok.com
  • Unified: https://video.api.vonage.com

All REST API endpoints should now use the Unified base domain. Be sure to update any hardcoded values in your application or server configuration.

For a complete list of endpoints and parameters, see the Unified REST API reference.

3. Confirm that your REST API integration works correctly. We recommend testing a simple request first. If you receive an authentication error, double-check that you are using Application ID + Private Key for Unified instead of Project Key + Secret from OpenTok.

Additional Information