Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.git
.github
*.md
LICENSE
examples/
test/
pkg/
.bundle/
.env
.env.*
*.jpg
35 changes: 35 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,40 @@ client.contact.set_do_not_text(false, phone: '+15551234567')
client.contact.set_do_not_text(true, contact_id: 'contact-abc-123')
```

### Contact Validator

Validate email addresses and phone numbers.

```ruby
require 'ccai'

# Initialize the client
client = CCAI.new(
client_id: 'YOUR-CLIENT-ID',
api_key: 'YOUR-API-KEY'
)

# Validate a single email
email_result = client.contact_validator.validate_email('user@example.com')
puts "Status: #{email_result['status']}" # "valid" | "invalid" | "risky"

# Validate multiple emails (up to 50)
bulk_emails = client.contact_validator.validate_emails(['user@example.com', 'bad@invalid.xyz'])
puts "Total: #{bulk_emails['summary']['total']}" # 2
puts "Valid: #{bulk_emails['summary']['valid']}" # 1

# Validate a single phone number
phone_result = client.contact_validator.validate_phone('+15551234567', country_code: 'US')
puts "Status: #{phone_result['status']}" # "valid" | "invalid" | "landline"

# Validate multiple phone numbers (up to 50)
bulk_phones = client.contact_validator.validate_phones([
{ phone: '+15551234567' },
{ phone: '+15559876543', countryCode: 'US' }
])
puts "Landline: #{bulk_phones['summary']['landline']}" # 1
```

### Webhooks

```ruby
Expand Down Expand Up @@ -356,6 +390,7 @@ ccai --type email --client-id YOUR-CLIENT-ID --api-key YOUR-API-KEY \
- Send MMS messages with images (automatic S3 upload)
- Send email campaigns with HTML content
- Manage contact opt-out preferences (set_do_not_text)
- Validate email addresses (valid/invalid/risky) and phone numbers (valid/invalid/landline)
- Manage webhooks: register, list, update, delete
- Webhook signature verification (HMAC-SHA256 with Base64 encoding)
- Template variable substitution (`${firstName}`, `${lastName}`)
Expand Down
15 changes: 15 additions & 0 deletions integration/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM ruby:3.2-slim

RUN apt-get update && apt-get install -y build-essential && rm -rf /var/lib/apt/lists/*

WORKDIR /sdk
COPY Gemfile Gemfile.lock ccai.gemspec ./
COPY lib/ ./lib/
RUN bundle install

COPY integration/Gemfile ./integration/
WORKDIR /sdk/integration
RUN bundle install

COPY integration/ ./
CMD ["bundle", "exec", "ruby", "test.rb"]
11 changes: 11 additions & 0 deletions integration/Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# frozen_string_literal: true

source 'https://rubygems.org'

# Load the CCAI SDK from the cloned repo
gem 'ccai', path: '..'

# Dependencies required by the SDK
gem 'faraday', '~> 2.0'
gem 'faraday-multipart', '~> 1.0'
gem 'json', '~> 2.0'
Loading