PHP code example of examinecom / convertkit

1. Go to this page and download the library: Download examinecom/convertkit 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/ */

    

examinecom / convertkit example snippets


     

    use \Examinecom\ConvertKit\ConvertKit;
    

    $this->client = new ConvertKit("{API_KEY}", "{API_SECRET}");
    

    $response = $this->client->tags()->all();
    var_dump($response);
    



namespace App;

use \Examinecom\ConvertKit\ConvertKit;

--------------*/
    private $client = null;
    
    public function __construct($apiKey, $apiSecret)
    {
        $this->client = new ConvertKit($apiKey, $apiSecret);
    }
    
    public function getTags()
    {
        $response = $this->client->tags()->all();

        return $response;
    }
}

$convertKit = new ConvertKitApp("APP_ID", "API_KEY");
$tags = $convertKit->getTags();
var_dump($tags);