AgentforceAPI
class AgentforceAPI
Network service layer providing comprehensive API access to Agentforce backend services and conversation management.
Parameter | Type | Description |
---|---|---|
network | Network | Network interface for HTTP operations |
domain | String? | Optional Salesforce domain override |
sse | AgentforceServerSentEvents | Server-Sent Events implementation |
credentialProvider | AgentforceAuthCredentialProvider | Authentication credential management |
instrumentationHandler | AgentforceInstrumentationHandler? | Analytics and performance monitoring |
configurationLocale | Locale? | Localization configuration |
agentforceLogger | Logger? | Logging interface implementation |
agentId | String? | Default agent identifier |
ioDispatcher | CoroutineDispatcher | Coroutine 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.
- AgentforceService - High-level service interface
- BotsAPI - Specialized conversation API client
- AgentforceComponent - UI component system integration