Download the PHP package klaviyo/sdk without Composer

On this page you can find all versions of the php package klaviyo/sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package sdk

Klaviyo PHP SDK (Legacy)

Legacy Notice

This SDK is set to be deprecated + retired on 2024-06-30.

We have a NEW PHP SDK to go along with our new API.

We recommend migrating over to our newest SDK.

You can read more about our SDK release history and support here

For a comparison between our old and new APIs, check out this guide.

Klaviyo PHP SDK

Helpful Resources

Design & Approach

This SDK is a thin wrapper around our API. See our API Reference for full documentation on API behavior.

This SDK mirrors the organization and naming convention of the above language-agnostic resources, with a few namespace changes to conform to PHP idioms (details in Appendix).

Organization

This SDK is organized into the following resources:

Installation

You can install this package using either Packagist, or the source code.

Option 1: Packagist

You can install this library using Packagist.

If you have composer installed, you can run: composer require klaviyo/sdk

Option 2: Source code

You can also install this library directly from source code, without using the Packagist package, as follows:

  1. cloning this repo
  2. running composer update (within the repo)

Usage Example

Retry behavior

Error Handling

This SDK throws an ApiException error when the server returns a non resolvable response, or a resolvable non-2XX response times out.

If you'd like to extend error handling beyond what the SDK supports natively, you can use the following methods to retrieve the corresponding attributes from the ApiException object:

For example:

Comprehensive list of Operations & Parameters

NOTE:

Campaigns

Cancel a Campaign

Clone a Campaign

Create New Campaign

Get Campaign Info

Get Campaign Recipients

Get Campaigns

Schedule a Campaign

Send a Campaign Immediately

Update Campaign

DataPrivacy

Request a Deletion

ListsSegments

Add Members to a List

Create List

Delete List

Exclude Profile From All Email

Get Global Exclusions & Unsubscribes

Get All Exclusions for a List

Get List Info

Check if Profiles Are in a List

Check if Profiles Are in a List and not Suppressed

Get Lists

Get List and Segment Members

Check if Profiles Are in a Segment

Remove Profiles From List

Subscribe Profiles to List

Unsubscribe Profiles From List

Update List Name

Metrics

Get Metrics Info

Query Event Data

Get Events for a Specific Metric

Get Events for All Metrics

Profiles

Exchange ID for Profile ID

Get Profile

Get Profile ID

Get Profile's Events for a Specific Metric

Get Profile's Events for all Metrics

Update Profile

Templates

Clone Template

Create New Template

Delete Template

Get All Templates

Render Template

Render and Send Template

Update Template

TrackIdentify

Identify Profile (Legacy)

Identify Profile

Track Profile Activity (Legacy)

Track Profile Activity

Appendix

Limitations

Namespace

In the interest of making the SDK conform to PHP idioms, we made the following namespace changes relative to the language agnostic resources up top (API Docs, Guides, etc).

For example:

Parameters & Arguments

The parameters follow the same naming conventions as the resource groups and operations.

We stick to the following convention for parameters/arguments

  1. All parameters are passed as function args.
  2. All optional params, as well as all Body and Form Data params (including required ones), are passed as keyword args.
  3. All query and path params that are tagged as required in the docs are passed as positional args.
  4. There is no need to pass in your private api_key for any operations, as it is defined upon client instantiation; public key is still required where noted for Track/Identify endpoints.

All versions of sdk with dependencies

PHP Build Version
Package Version
Requires php Version ^7.3 || ^8.0
ext-curl Version *
ext-json Version *
ext-mbstring Version *
guzzlehttp/guzzle Version ^7.3
guzzlehttp/psr7 Version ^1.7 || ^2.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package klaviyo/sdk contains the following files

Loading the files please wait ....