Package 

Class TokenService


  • 
    public final class TokenService
    
                        

    Service for fetching conversation tokens from ElevenLabs API

    This service handles authentication with the ElevenLabs API to obtain conversation tokens for private agents and connection details.

    • Constructor Summary

      Constructors 
      Constructor Description
      TokenService(String baseUrl, OkHttpClient httpClient, Gson gson)
    • Method Summary

      Modifier and Type Method Description
      final TokenResponse fetchPublicAgentToken(String agentId, String source, String version, String environment) Fetch a conversation token for a public agent (no API key required)
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • TokenService

        TokenService(String baseUrl, OkHttpClient httpClient, Gson gson)
    • Method Detail

      • fetchPublicAgentToken

         final TokenResponse fetchPublicAgentToken(String agentId, String source, String version, String environment)

        Fetch a conversation token for a public agent (no API key required)

        Parameters:
        agentId - The ID of the public agent to get a token for
        source - Optional source identifier (defaults to "android_sdk")
        version - Optional version string (defaults to SDK version)
        environment - Optional environment name (defaults to "production" on the server)