Skip to content

Releases: Kit/ConvertKitSDK-PHP

2.1

17 Dec 16:10
50d7e62
Compare
Choose a tag to compare

2.0

17 Apr 13:16
Compare
Choose a tag to compare
2.0

Version 2.0 of the SDK uses ConvertKit's v4 API, which replaces API Keys with OAuth, and introduces a number of new methods.

As such, this introduces a number of breaking changes, and it's strongly recommended to refer to the migration guide to migrate from the v1 SDK.

Documentation

Documentation can be found here.

PHP Version

The minimum supported PHP version is 8.0. Users on older PHP versions should continue to use the v1 SDK.

Authentication

Authentication is now via OAuth. It's recommended to refer to the README file's Getting Started section for implementation.

Initializing the ConvertKit_API class now accepts a clientID, clientSecret and accessToken in place of the existing api_key and api_secret:

$api = new \ConvertKit_API\ConvertKit_API(
    clientID: '<your_oauth_client_id>',
    clientSecret: '<your_oauth_client_secret>',
    accessToken: '<your_oauth_access_token>'
);

Pagination

For list based endpoints which fetch data from the API (such as broadcasts, custom fields, subscribers, tags, email templates, forms, purchases etc.), cursor based pagination is used. The following parameters can be specified in the API methods:

  • per_page: Defines the number of results to return, with a maximum value of 100
  • after_cursor: When specified, returns the next page of results based on the current result's pagination->end_cursor value
  • before_cursor: When specified, returns the previous page of results based on the current result's pagination->start_cursor value

Accounts

  • Added: get_account_colors()
  • Added: update_account_colors()
  • Added: get_creator_profile()
  • Added: get_email_stats()
  • Added: get_growth_stats()

Broadcasts

  • Updated: get_broadcasts() supports pagination
  • Updated: create_broadcast():
    • email_layout_template is now email_template_id. To fetch the ID of the account's email templates, refer to get_email_templates()
    • preview_text option added
    • subscriber_filter option added
  • Updated: update_broadcast()
    • email_layout_template is now email_template_id. To fetch the ID of the account's email templates, refer to get_email_templates()
    • preview_text option added
    • subscriber_filter option added
  • Changed: destroy_broadcast() is renamed to delete_broadcast()

Custom Fields

  • Added: create_custom_fields() to create multiple custom fields in a single request
  • Updated: get_custom_fields() supports pagination

Subscribers

  • Added: create_subscriber(). The concept of creating a subscriber via a form, tag or sequence is replaced with this new method. The subscriber can then be subscribed to resources (forms, tag, sequences) as necessary.
  • Added: create_subscribers() to create multiple subscribers in a single request
  • Added: get_subscribers()
  • Changed: unsubscribe() is now unsubscribe_by_email(). Use unsubscribe() for unsubscribing by a subscriber ID
  • Updated: get_subscriber_tags() supports pagination

Tags

  • Added: create_tags() to create multiple tags in a single request
  • Updated: get_tags() supports pagination
  • Updated: get_tag_subscriptions():
    • supports pagination
    • supports filtering by subscribers by dates, covering created_after, created_before, tagged_after and tagged_before
    • sort_order is no longer supported
  • Changed: tag_subscriber() is now tag_subscriber_by_email(). Use tag_subscriber() for tagging by subscriber ID

Email Templates

  • Added: get_email_templates()

Forms

  • Updated: get_forms():
    • supports pagination
    • only returns active forms by default. Use the status parameter to filter by active, archived, trashed or all
  • Updated: get_landing_pages():
    • supports pagination
    • only returns active landing pages by default. Use the status parameter to filter by active, archived, trashed or all
  • Updated: get_form_subscriptions():
    • supports pagination
    • supports filtering by subscribers by dates, covering created_after, created_before, added_after and added_before
    • sort_order is no longer supported
  • Changed: add_subscriber_to_form() is now add_subscriber_to_form_by_email(). Use add_subscriber_to_form() for adding subscriber to form by subscriber ID

Purchases

  • Updated: create_purchase() now supports named parameters for purchase data, instead of an $options array
  • Changed: list_purchases() is now get_purchases(), with pagination support

Segments

  • Added: get_segments()

Sequences

  • Changed: add_subscriber_to_sequence() is now add_subscriber_to_sequence_by_email(). Use add_subscriber_to_sequence() for adding a subscriber to a sequence by subscriber ID
  • Updated: get_sequences() supports pagination
  • Updated: get_sequence_subscriptions():
    • supports pagination
    • supports filtering by subscribers by dates, covering created_after, created_before, added_after and added_before
    • sort_order is no longer supported

Webhooks

  • Added: get_webhooks()
  • Changed: destroy_webhook() is now delete_webhook()

Other

  • Removed: form_subscribe() was previously deprecated. Use add_subscriber_to_form() or add_subscriber_to_form_by_email()
  • Removed: add_tag() was previously deprecated. Use tag_subscriber() or tag_subscriber_by_email()

1.3

18 Jul 18:20
eda6d82
Compare
Choose a tag to compare
1.3
  • Added: set_http_client method (#68)
  • Added: Option to specify log location in ConvertKit_API constructor (#69)
  • Added: Logging: Mask API Key and Secret if detected in log message (#69)

1.2

03 Jul 16:13
562a14f
Compare
Choose a tag to compare
1.2

Documentation

Documentation for 1.2 can be found here.

Features / Additions

  • Added: Use monolog/3.x in PHP 8.1+ (@jtolj)

1.1

01 May 16:43
Compare
Choose a tag to compare
1.1

Documentation

Documentation for 1.1 can be found here.

Features / Additions

  • Added create_tags() method (docs, #62)

1.0

23 Mar 16:00
2d317ea
Compare
Choose a tag to compare
1.0

Documentation

Documentation for 1.0 can be found here.

Deprecations / Notices

  • PHP: Minimum supported version is now 7.4
  • add_tag() will trigger an E_USER_NOTICE, as the method name is misleading, and we prefer methods with named arguments; use tag_subscribe() (#44)
  • form_subscribe() will trigger an E_USER_NOTICE, as we prefer methods with named arguments; use add_subscriber_to_form() (#54)
  • form_unsubscribe() will trigger an E_USER_NOTICE, as the method name is misleading, and we prefer methods with named arguments; use unsubscribe() (#45)

Features / Additions

  • Added User-Agent on API requests (#34)
  • Added get(), post(), put() and delete() methods (#36)
  • Added get_forms() and get_landing_pages() methods (#41)
  • Added get_form_subscriptions() method (#42)
  • Added Tag methods get_tags(), create_tag(), tag_subscriber(), remove_tag_from_subscriber(), remove_tag_from_subscriber_by_email() (#44)
  • Added Subscriber methods update_subscriber(), unsubscribe() (#45)
  • Added add_subscriber_to_sequence() to support name, custom fields and tags (#43)
  • Added Custom Field methods get_custom_fields(), add_custom_field(), add_custom_fields(), update_custom_field(), delete_custom_field() (#46)
  • Added Purchase method get_purchase() (#47)
  • Added Webhook methods create_webhook(), `destroy_webhook() (#48)
  • Added Broadcast methods create_broadcast(), get_broadcast(), get_broadcast_stats(), update_broadcast(), destroy_broadcast()

Fixes / Improvements

  • Fixed: Guzzle version set to 6.5 or higher (#20, #26, #27)
  • Fixed: get_subscriber_id() performance (#21, #22, #29, #39)
  • Refactored: fetching legacy forms and landing pages (#32)
  • Refactored: using api_version property, API calls and logging (#37, #38)
  • Removed: Caching of resources and markup in class life cycle (#52)
  • Removed: InvalidArgumentException where type hints for methods now exist (#43)

Testing

  • Added PHPStan static analysis (#40)
  • Added PSR-12 coding standards with some modifications (#33)
  • Updated PHPUnit test coverage (#30, #35)

0.1

01 Mar 16:07
e92084f
Compare
Choose a tag to compare
0.1

Introduces versioning to the ConvertKit PHP SDK.

Users relying on dev-master should use this 0.1 release to maintain compatibility with no breaking changes.