Download the PHP package cloudcontactai/ccai-php without Composer
On this page you can find all versions of the php package cloudcontactai/ccai-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download cloudcontactai/ccai-php
More information about cloudcontactai/ccai-php
Files in cloudcontactai/ccai-php
Package ccai-php
Short Description PHP client for CloudContactAI API
License MIT
Informations about the package ccai-php
CCAI PHP Client
A PHP client for interacting with the CloudContactAI API, with support for SMS, MMS, email campaigns, webhooks, contact management, brand registration for TCR verification, and campaign registration for TCR carrier vetting.
Installation
Requirements
- PHP 8.1 or higher
- Composer
- GuzzleHttp 7.7+
Configuration
You can configure the client using environment variables:
Or provide them directly in your code:
Usage
Sending SMS Messages
SMS — Template-Controlled Accounts
If an account has been configured to enforce template-only messaging, all campaigns must reference a pre-approved template ID. Sending a free-text message to such an account will result in a 422 error.
The message body is resolved server-side from the template. Variable substitution (e.g. ${firstName}) is applied automatically using the recipient's account data.
Sending MMS Messages
Sending Email
Managing Contacts
Manage opt-out preferences for contacts.
Contact Validator
Validate email addresses and phone numbers.
Bulk endpoints accept up to 50 contacts per request and are processed server-side in chunks.
Brand Registration
Register and manage brands for TCR verification.
Entity Types: PRIVATE_PROFIT, PUBLIC_PROFIT, NON_PROFIT, GOVERNMENT, SOLE_PROPRIETOR
Note:
PUBLIC_PROFITentities requirestockSymbolandstockExchangefields.
Vertical Types: AUTOMOTIVE, AGRICULTURE, BANKING, COMMUNICATION, CONSTRUCTION, EDUCATION, ENERGY, ENTERTAINMENT, GOVERNMENT, HEALTHCARE, HOSPITALITY, INSURANCE, LEGAL, MANUFACTURING, NON_PROFIT, PROFESSIONAL, REAL_ESTATE, RETAIL, TECHNOLOGY, TRANSPORTATION
Campaign Registration
Register and manage campaigns for TCR carrier vetting.
Use Cases: TWO_FACTOR_AUTHENTICATION, ACCOUNT_NOTIFICATION, CUSTOMER_CARE, DELIVERY_NOTIFICATION, FRAUD_ALERT, HIGHER_EDUCATION, LOW_VOLUME_MIXED, MARKETING, MIXED, POLLING_VOTING, PUBLIC_SERVICE_ANNOUNCEMENT, SECURITY_ALERT
Note:
MIXEDandLOW_VOLUME_MIXEDcampaigns require 2–3subUseCases.
Sub-Use Cases: TWO_FACTOR_AUTHENTICATION, ACCOUNT_NOTIFICATION, CUSTOMER_CARE, DELIVERY_NOTIFICATION, FRAUD_ALERT, MARKETING, POLLING_VOTING
Webhooks
Brand Registration
Register and manage brands for TCR (The Campaign Registry) business verification.
Entity Types
PRIVATE_PROFIT, PUBLIC_PROFIT, NON_PROFIT, GOVERNMENT, SOLE_PROPRIETOR
Note:
PUBLIC_PROFITentities requirestockSymbolandstockExchangefields.
Vertical Types
AUTOMOTIVE, AGRICULTURE, BANKING, COMMUNICATION, CONSTRUCTION, EDUCATION, ENERGY, ENTERTAINMENT, GOVERNMENT, HEALTHCARE, HOSPITALITY, INSURANCE, LEGAL, MANUFACTURING, NON_PROFIT, PROFESSIONAL, REAL_ESTATE, RETAIL, TECHNOLOGY, TRANSPORTATION
Campaign Registration
Register and manage campaigns for TCR (The Campaign Registry) carrier vetting. Each campaign must be linked to a verified brand.
Use Cases
TWO_FACTOR_AUTHENTICATION, ACCOUNT_NOTIFICATION, CUSTOMER_CARE, DELIVERY_NOTIFICATION, FRAUD_ALERT, HIGHER_EDUCATION, LOW_VOLUME_MIXED, MARKETING, MIXED, POLLING_VOTING, PUBLIC_SERVICE_ANNOUNCEMENT, SECURITY_ALERT
Note:
MIXEDandLOW_VOLUME_MIXEDcampaigns require 2–3subUseCases.
termsLinkandprivacyLinkare optional fields on the campaign array.
Sub-Use Cases
TWO_FACTOR_AUTHENTICATION, ACCOUNT_NOTIFICATION, CUSTOMER_CARE, DELIVERY_NOTIFICATION, FRAUD_ALERT, MARKETING, POLLING_VOTING
Example Files
Run the example files:
Example Files
This repository includes example files for sending SMS, MMS, and Email messages:
send_sms.php- Example of sending SMS messagessend_mms.php- Example of sending MMS messages with an imagesend_email.php- Example of sending email messages
Features
- Send SMS messages to single or multiple recipients
- Send MMS messages with images (automatic S3 upload)
- Send Email campaigns with HTML content
- Schedule emails for future delivery
- Manage contact opt-out preferences (setDoNotText)
- Validate email addresses (valid/invalid/risky) and phone numbers (valid/invalid/landline)
- Brand registration and management for TCR verification
- Campaign registration and management for TCR carrier vetting
- Webhook management: register, update, list, delete
- Webhook event handling for web frameworks
- Webhook signature verification (HMAC-SHA256 with Base64 encoding)
- Template variable substitution (
${firstName},${lastName}) - Progress tracking callbacks
- Type hints for better IDE integration
- Comprehensive error handling
- PSR-7 and PSR-18 compliant
Removed Functionality
The following methods have been removed as they do not exist in the backend API:
SMS::getCampaignStatus()- Use backend API directly for campaign statusEmail::getCampaignStatus()- Use backend API directly for campaign status
License
MIT
All versions of ccai-php with dependencies
guzzlehttp/guzzle Version ^7.7
psr/http-client Version ^1.0
psr/http-message Version ^1.0
psr/log Version ^3.0