Prerequisites
Before using these APIs, configure authentication as described in Mobile Authentication.Conversations
Retrieves the list of conversations for the authenticated user. Endpoint:GET /api/sdk/v1/conversations
Response:
Usage Notes:
- Returns up to 100 most recent conversations
- Conversations are sorted by last message date (newest first)
- Each conversation contains a unique ID used to retrieve messages
Get Conversation with Messages
Retrieves a specific conversation with all its messages. Endpoint:GET /api/sdk/v1/conversations/{conversation_id}
Parameters:
conversation_id(path): UUID of the conversation
Send New Message
Sends a new message to start or continue a conversation. Endpoint:POST /api/sdk/v1/messages
Request Body:
Omit the
thread field to start a new conversation. Include it to continue an existing thread.SSE Response Format
The response is sent as Server-Sent Events (SSE) stream for real-time updates.Event Format
Each SSE message follows this format:SSE Message Structure
Status Values
Example Stream
Form Presentation
If a form should be presented to the user (e.g., ticket creation):JavaScript Implementation
Kotlin Implementation
Fallback Polling
If SSE streaming fails or is not supported, use polling as a fallback.When to Use Polling
- SSE connection fails or times out
- Behind proxy that doesn’t support streaming
- Mobile SDK with limited SSE support
- Testing/debugging scenarios
Polling Endpoint
Endpoint:GET /api/sdk/v1/messages/{message_id}/status
Response:
Polling Implementation
Polling Best Practices:
- Poll every 2 seconds to balance responsiveness and server load
- Set a maximum polling duration (e.g., 2-3 minutes)
- Update UI with partial content while polling
- Retry on network errors, stop on 4xx errors
Best Practices
Related Documentation
- Mobile Authentication - Authentication setup
- Mobile Ticketing API - Create support tickets
- Mobile SDK Examples - Complete implementation examples
- Send Message API - Full API reference
