PHP code example of firewards / getrevue-php

1. Go to this page and download the library: Download firewards/getrevue-php library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

firewards / getrevue-php example snippets


$apiKey = "your-key-goes-here";
$api = new \Firewards\GetRevueApi($apiKey);

$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"
}
 */

if ($api->unsubscribe("[email protected]")) {
    // unsbuscribed
}

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"
        }
     */
}

foreach ($api->getLists()) {
    
}

$list = $api->getList(13212);
 bash
$ composer