Unofficial GetRevue PHP API for v2.
This package makes it simple to access GetRevues's web API. Checkout https://www.getrevue.co/api for more information on GetRevue's API.
Via Composer
$ composer require firewards/getrevue-php
The following versions of PHP are supported.
- PHP 7.0
- PHP 7.1
- PHP 7.2
- PHP 7.3
- PHP 7.4
All API calls require an API Key. You can find your API Key in the GetRevue Account page under the Integrations tab (scroll all the way down).
Start by using GetRevueAPI and creating an instance with your ConvertKit API key
$apiKey = "your-key-goes-here";
$api = new \Firewards\GetRevueApi($apiKey);
Add a new email to your list of subscribers.
$subscriber = $this->api->addSubscriber("[email protected]", 'firstName', 'lastName');
/**
Return example:
array(6) {
["id"]=>
int(42840832)
["list_id"]=>
int(64471)
["email"]=>
string(26) "[email protected]"
["first_name"]=>
string(9) "firstName"
["last_name"]=>
string(8) "lastName"
["last_changed"]=>
string(24) "2020-12-24T02:21:26.333Z"
}
*/
Unsubscribe an existing subscriber by email. Revue is not returning any success or failure codes.
if ($api->unsubscribe("[email protected]")) {
// unsbuscribed
}
Get all subscribers and iterate through them. Revue's API does not support paging, yet. The API will return 5000 subscribers.
foreach ($api->getSubscribers() as $subscriber) {
/*
* array(6) {
["id"]=>
int(42840832)
["list_id"]=>
int(64471)
["email"]=>
string(26) "[email protected]"
["first_name"]=>
string(9) "firstName"
["last_name"]=>
string(8) "lastName"
["last_changed"]=>
string(24) "2020-12-24T02:21:26.333Z"
}
*/
}
Get all available lists (subscriber groups).
foreach ($api->getLists()) {
}
Return information about a specific list using its id.
$list = $api->getList(13212);
The MIT License (MIT). Please see License File for more information.
This package is sponsored by www.firewards.com, Firewards makes it easy to setup a referral and rewards program for your email list and newsletter.