Browse SDKs · Android
Platform
SDKsAndroidEnterprise

Get call room token

Retrieve or refresh access credentials for an active calling room by room ID using signalingGetTokenByRoomID().

Copy

When the client knows the roomID but needs to acquire or refresh media room access tokens, fetch updated credentials using signalingGetTokenByRoomID():

Code example

OpenIMClient.getInstance().signalingManager.signalingGetTokenByRoomID(
    new OnBase<SignalingCertificate>() {
        @Override
        public void onSuccess(SignalingCertificate credentials) {
            // credentials provides roomID, token, and liveURL to connect to the media room.
        }

        @Override
        public void onError(int code, String error) {
            // code and error describe the failure.
        }
    },
    roomID
);

Parameters

ParameterTypeRequiredDescription
baseOnBase<SignalingCertificate>YesCallback delivering the asynchronous operation result.
roomIDStringYesTarget call room identifier.

Return value

The successful callback returns a SignalingCertificate object containing:

  • roomID: Unique global identifier of the call room.
  • token: Authentication token used to join the media room.
  • liveURL: Media server endpoint URL.
  • busyLineUserIDList: List of busy users.

Once valid credentials are received, connect to your media engine. If credentials expire during reconnection or extended waiting, call this method again to refresh them.