dotdigital / dotdigital-php
Dotdigital PHP Library
Installs: 171 653
Dependents: 3
Suggesters: 0
Security: 0
Stars: 3
Watchers: 6
Forks: 6
Open Issues: 0
Requires
- php: ^7.4 || ^8.0
- ext-json: *
- php-http/client-common: ^2.4
- php-http/discovery: ^1.15.0
- psr/http-client: ^1.0
- psr/http-factory: ^1.0
Requires (Dev)
- fakerphp/faker: ^1.22
- guzzlehttp/guzzle: ^7.4
- php-http/curl-client: ^2.2
- phpstan/phpstan: ^1.0
- phpunit/phpunit: ^9.6
- symfony/dotenv: ^5.4
- symplify/easy-coding-standard: ^9.4
This package is auto-updated.
Last update: 2024-11-07 15:40:03 UTC
README
A PHP wrapper for the Dotdigital API.
Requirements
- An active account with Dotdigital plus valid API user credentials.
- PHP >= 7.4. We recommend PHP 8 - however the code will run on PHP 7.4 with the correct constraints in your own composer.json.
- A PSR-7 implementation
- A PSR-17 implementation
- A PSR-18 implementation
Setup
- Require this package:
composer require dotdigital/dotdigital-php
- Require an HTTP factory implementation from this list, for example:
composer require guzzlehttp/psr7
- Require an HTTP client package of your choice from this list, for example:
composer require php-http/curl-client
Example usage
# app/index.php require_once __DIR__ . '/vendor/autoload.php'; $dotdigital = new \Dotdigital\V2\Client(); $dotdigital::setApiUser('apiuser-123@apiconnector.com'); $dotdigital::setApiPassword(''); $dotdigital::setApiEndpoint('https://r1-api.dotdigital.com'); $accountInfo = $dotdigital->accountInfo->show();
API versions
Dotdigital began releasing endpoints for a new v3 API in May 2023. Initially these endpoints are in public preview, and only available to merchants with certain Dotdigital account configurations.
As of version 2.0.0, this SDK wraps both the v2 and the v3 APIs. It will be updated to wrap new v3 endpoints as they become required by our integrations.
V2
$dotdigital = new \Dotdigital\V2\Client();
V3
$dotdigital = new \Dotdigital\V3\Client();