Suggestions

close search

Moderation — REST

In addition to moderating connected client endpoints from the OpenTok.js SDK, app servers may issue an HTTP DELETE from the server side to force a connected client to disconnect from a session.

Force a client endpoint to disconnect from a session

Your application server can disconnect a client from an OpenTok session by sending an HTTP DELETE request to the resource for that client's connection:

SESSION_ID=SOME_SESSION_ID
CONNECTION_ID=SOME_CONNECTION_ID
API_KEY=123456
API_SECRET=ABCDEF1234567890
curl -v \
-X DELETE \
-H "X-OPENTOK-AUTH:JSON_WEB_TOKEN" \
https://api.opentok.com/v2/project/${API_KEY}/session/${SESSION_ID}/connection/${CONNECTION_ID}

For more information, see the OpenTok REST API documentation.