respond_io_sdk 0.0.2
respond_io_sdk: ^0.0.2 copied to clipboard
Official Respond.io SDK for Flutter - Manage contacts, send messages, and integrate with Respond.io API
Respond.io SDK for Flutter #
Important
This package is private and not published to pub.dev. It is intended for internal use only.
A comprehensive Flutter SDK for integrating with the Respond.io API. Manage contacts, send messages, handle conversations, and more.
Features #
- 🔐 Authentication - Secure API token-based authentication
- 👥 Contact Management - Create, update, delete, and search contacts
- 💬 Messaging - Send and retrieve messages
- 🔄 Conversations - Manage conversation lifecycle
- 💭 Comments - Add internal comments to conversations
- 🏢 Workspace - Access workspace-level operations
- ⚡ Rate Limiting - Built-in rate limit handling with automatic retries
- 🛡️ Error Handling - Comprehensive exception handling
- 📦 Type Safety - Immutable models using Freezed
Getting Started #
Installation #
Add this to your package's dependencies:
dependencies:
respond_io_sdk:
git:
url: https://github.com/salahaldeenalmamary/respond_io_sdk.git
ref: main
Authentication #
Get your API access token from your Respond.io workspace:
- Go to Settings → Integrations → Developer API
- Generate a new API Access Token
- Copy the token for use in your app
Usage #
Initialize the SDK #
import 'package:respond_io_sdk/respond_io_sdk.dart';
final respondIO = RespondIO(
RespondIOConfig(
apiToken: 'your_api_token_here',
maxRetries: 3,
timeout: 30000,
),
);
Contact Management #
// Create or update a contact
final contact = await respondIO.contacts.createOrUpdate(
'phone:+1234567890',
ContactFields(
firstName: 'John',
lastName: 'Doe',
email: 'john@example.com',
phone: '+1234567890',
),
);
// Get a contact
final contact = await respondIO.contacts.get('phone:+1234567890');
// Update a contact
await respondIO.contacts.update(
'phone:+1234567890',
ContactFields(firstName: 'Jane'),
);
// Delete a contact
await respondIO.contacts.delete('phone:+1234567890');
Messaging #
// Send a text message
final response = await respondIO.messaging.send(
'phone:+1234567890',
SendMessageRequest(
message: MessageContent(
type: 'text',
text: 'Hello from Flutter!',
),
),
);
// Get message history
final messages = await respondIO.messaging.list(
'phone:+1234567890',
pagination: PaginationParams(limit: 50),
);
Error Handling #
try {
final contact = await respondIO.contacts.get('phone:+1234567890');
} on RespondIOException catch (e) {
print('Error: ${e.message}');
print('Status Code: ${e.statusCode}');
if (e.rateLimitInfo != null) {
print('Rate limit: ${e.rateLimitInfo!.remaining}/${e.rateLimitInfo!.limit}');
print('Retry after: ${e.rateLimitInfo!.retryAfter} seconds');
}
}
Contact Identifiers #
Respond.io supports multiple identifier types:
phone:+1234567890- Phone number (must include country code with +)email:user@example.com- Email addressid:12345- Contact ID
API Reference #
Available Clients #
contacts- Contact management operationsmessaging- Send and retrieve messagesconversations- Conversation managementcomments- Internal commentsspace- Workspace-level operations
For detailed API documentation, see the Respond.io API Documentation.
License #
MIT License
Copyright (c) 2026 Salah Almamari
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.