2017 © Pedro Peláez
 

library convertkit

ConvertKit SDK

image

surefirejack/convertkit

ConvertKit SDK

  • Wednesday, February 15, 2017
  • by surefirejack
  • Repository
  • 2 Watchers
  • 1 Stars
  • 2,533 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 2 Versions
  • 16 % Grown

The README.md

Convertkit SDK

This is the (unofficial) ConvertKit SDK for working with the ConvertKit API, (*1)

We created this for the API integration with our software, Deadline Funnel (https://deadlinefunnel.com)., (*2)

Install

Either download and include, or install via Composer:, (*3)

composer require surefirejack/convertkit

Make a simple request

Create a new ConvertKit object with, (*4)

  1. Your user's API Key
  2. Your user's API Secret Key
require_once __DIR__.'/vendor/autoload.php';

use ConvertKit\ConvertKit;

$apiKey = 'api-key-here';
$apiSecretKey = 'api-secret-key-here';

$ck = new ConvertKit($apiKey, $apiSecretKey);

List all sequences:, (*5)

$sequences = $ck->sequence();
$response = $sequences->showall();
print_r($response);

List all subscribers:, (*6)

$subscriber = $ck->subscriber();
$response = $subscriber->showall();
print_r($response);

// Show the details of the first subscriber returned
$firstName = $response->subscribers[0]->first_name;
$email = $response->subscribers[0]->email_address;
$fieldsObject = $response->subscribers[0]->fields;

View details of a specific subscriber, (*7)

$subscriberId = 123456;
$response = $ck->subscriber($subscriberId)->view();
print_r($response);

Update a subscriber's custom fields, (*8)


$subscriberId = 123456; $customFields = array( 'fields' => array( 'deadlinetext' => 'Jan 22 2018' ) ); $response = $ck->subscriber($subscriberId)->update($customFields); print_r($response);

View all forms, (*9)

$response = $ck->form()->showall();
print_r($response);

View all custom fields, (*10)

$response = $ck->customfield()->showall();
print_r($response);

Delete a custom field, (*11)

$customFieldId = 567;

$customfield = $ck->customfield();
$response = $customfield->delete($customFieldId);

print_r($response);

Add webhook, (*12)

// Register a webhook to be pinged when a subscriber recieves a tag
$tagId = 789;
$webhookUrl = "http://example.com/incoming";

$params = array(
    "target_url" => $webhookUrl,
    "event" => array(
        'name' => 'subscriber.tag_add',
        'tag_id'=> $tagId
    )

);

$webhook = $ck->webhook();
$response = $webhook->add($params);
print_r($response);

The Versions

15/02 2017

dev-master

9999999-dev https://github.com/surefirejack/convertkit

ConvertKit SDK

  Sources   Download

MIT

The Requires

  • php >=5.3.0
  • lib-curl *

 

convertkit

15/02 2017

dev-alex-delete-webhook/master

dev-alex-delete-webhook/master https://github.com/surefirejack/convertkit

ConvertKit SDK

  Sources   Download

MIT

The Requires

  • php >=5.3.0
  • lib-curl *

 

convertkit