Skip to main content

Concepts: Basics

This topic guides you through the standard practices utilized in OpenTok Video API and illustrates how they correspond with Dyte's API. The main purpose of this tutorial is to support you in migrating an existing application from OpenTok to Dyte's video and audio APIs.

Overview​

Here's a brief overview of the architecture used by OpenTok and Dyte.

For more information on how to get started with Dyte, see Integrate Dyte.

Credentials​

To access OpenTok's API, you need an session ID and auth Token. You generate a token for each user connecting to an OpenTok session. For more information, Token Creation Overview.

Dyte uses Organization ID and API Key that you can get from the Developer Portal.

OpenTokDyte
Session IDOrganization ID
Auth tokenAPI Key

Session / Meeting​

OpenTok utilizes Sessions to establish connections between participants, whereas Dyte uses Meetings for the same purpose.

OpenTokDyte
SessionMeeting
Session IDMeeting ID

Participant Authentication​

In OpenTok, hashing function and secret are used to generate a participant access token. Foe example, for Java:

import com.opentok.OpenTok;
import com.opentok.exception.OpenTokException;

class Test {
public static void main(String argv[]) throws OpenTokException {
// Set the following constants to your OpenTok API key and API secret.
// See https://tokbox.com/account/.
OpenTok opentok = new OpenTok(API_KEY, API_SECRET);

//Generate a basic session. Or you could use an existing session ID.
String sessionId = opentok.createSession().getSessionId();

String token = opentok.generateToken(sessionId);
System.out.println(token);
}
}

In Dyte, you make a REST API call to Add Participant API which returns authToken.

OpenTokDyte
Access TokenAuthtoken