respond_io_sdk 0.0.1 copy "respond_io_sdk: ^0.0.1" to clipboard
respond_io_sdk: ^0.0.1 copied to clipboard

Official Respond.io SDK for Flutter - Manage contacts, send messages, and integrate with Respond.io API

Respond.io SDK for Flutter #

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:
    path: packages/respond_io_sdk

Authentication #

Get your API access token from your Respond.io workspace:

  1. Go to Settings → Integrations → Developer API
  2. Generate a new API Access Token
  3. 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 address
  • id:12345 - Contact ID

API Reference #

Available Clients #

  • contacts - Contact management operations
  • messaging - Send and retrieve messages
  • conversations - Conversation management
  • comments - Internal comments
  • space - Workspace-level operations

For detailed API documentation, see the Respond.io API Documentation.

License #

This package is private and not published to pub.dev.

0
likes
80
points
--
downloads

Publisher

unverified uploader

Weekly Downloads

Official Respond.io SDK for Flutter - Manage contacts, send messages, and integrate with Respond.io API

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

dio, flutter, freezed_annotation, json_annotation

More

Packages that depend on respond_io_sdk