AgentforceAPI

class AgentforceAPI

Network service layer providing comprehensive API access to Agentforce backend services and conversation management.

ParameterTypeDescription
networkNetworkNetwork interface for HTTP operations
domainString?Optional Salesforce domain override
sseAgentforceServerSentEventsServer-Sent Events implementation
credentialProviderAgentforceAuthCredentialProviderAuthentication credential management
instrumentationHandlerAgentforceInstrumentationHandler?Analytics and performance monitoring
configurationLocaleLocale?Localization configuration
agentforceLoggerLogger?Logging interface implementation
agentIdString?Default agent identifier
ioDispatcherCoroutineDispatcherCoroutine dispatcher for background operations

AgentforceAPI serves as the primary interface for network communication with Agentforce backend services. It handles authentication, request/response processing, real-time event streaming, and error management in a coroutine-friendly architecture.

Essential capabilities of the AgentforceAPI for network communication and conversation management.

  • Start and manage agent conversation sessions
  • Send user messages and receive agent responses
  • Handle conversation state transitions
  • Support for conversation persistence and restoration
  • Server-Sent Events (SSE) for live message streaming
  • Connection management and automatic reconnection
  • Event filtering and processing
  • WebSocket fallback support
  • OAuth 2.0 token management
  • Automatic token refresh
  • Org JWT support for service accounts
  • Secure credential storage and retrieval

Common patterns for initializing and using the AgentforceAPI.

Comprehensive error handling patterns for network and API failures.

Integration patterns for authentication and credential management.

Real-time event streaming capabilities for live conversation updates.

Monitoring and logging capabilities for API performance and debugging.

Integration patterns for external dependencies and service providers.

Advanced configuration options for API customization and localization.

For detailed configuration examples including locale and dispatcher configuration, see the Android SDK Developer Guide.