Download the PHP package budgetlens/laravel-copernica-rest-client without Composer
On this page you can find all versions of the php package budgetlens/laravel-copernica-rest-client. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download budgetlens/laravel-copernica-rest-client
More information about budgetlens/laravel-copernica-rest-client
Files in budgetlens/laravel-copernica-rest-client
Package laravel-copernica-rest-client
Short Description A fluent PHP (Laravel) REST client for the Copernica Marketing Software API v4
License MIT
Informations about the package laravel-copernica-rest-client
Laravel Copernica REST Client for PHP
A fluent, modern PHP (Laravel) client for the Copernica Marketing Software REST API v4. Built with clean architecture, strongly-typed DTOs, and first-class Laravel support.
Requirements
- PHP 8.3 or higher
- Composer
- A Copernica account with a REST API v4 access token - Generate your access_token
- GuzzleHTTP 7.0+ (installed automatically via Composer)
Installation
Laravel
The package supports Laravel auto-discovery. After installation, add your access token to .env:
Optionally publish the configuration file:
This publishes config/copernica.php where you can configure:
| Option | Env Variable | Default |
|---|---|---|
access_token |
COPERNICA_ACCESS_TOKEN |
"" |
base_url |
COPERNICA_BASE_URL |
https://api.copernica.com/v4 |
timeout |
COPERNICA_TIMEOUT |
30 |
Tip: Use
https://rest.copernica.com/v4as base URL for large dataset retrieval.
Standalone (without Laravel)
Quick Start
Usage
Account Information
Databases
Fields
Profiles
Subprofiles
Collections
Views
Emailings
Webhooks
Raw API Access
For endpoints not yet covered by the client, you can use the raw HTTP methods:
Error Handling
The client throws specific exceptions for different error scenarios:
All exceptions extend CopernicaException, which extends RuntimeException. You can catch CopernicaException to handle all API errors at once.
DTOs
All API responses are mapped to strongly-typed Data Transfer Objects:
| DTO | Description |
|---|---|
Database |
Database with ID, name, description, archived status, fields, interests, collections |
Collection |
Database collection with ID, name, parent database, and fields |
Field |
Database/collection field with type, length, and display settings |
Profile |
Contact record with fields, interests, and timestamps |
Subprofile |
Collection subprofile with fields and timestamps |
View |
Database view with rules and rebuild status |
Emailing |
Email campaign (HTML or Drag & Drop) with content details |
EmailingDestination |
Single emailing recipient with profile/subprofile ID |
EmailingStatistics |
Aggregated statistics (deliveries, impressions, clicks, etc.) |
Webhook |
Webhook subscription with handler, URL, and trigger type |
All DTOs implement the FromArray contract and are immutable (readonly properties).
Architecture
Testing
Tests use PHPUnit 11 and Orchestra Testbench for Laravel integration testing.
License
MIT License. See LICENSE for details.