Download the PHP package klaviyo/api without Composer

On this page you can find all versions of the php package klaviyo/api. 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 api

Klaviyo PHP SDK

Helpful Resources

Design & Approach

This SDK is a thin wrapper around our API. See our API Reference for full documentation on 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 our Packagist package:

Usage Example

Use Case Examples

How to use filtering, sorting, and spare fieldset JSON API features

Use Case: Get events associated with a specific metric, then return just the event properties sorted by oldest to newest datetime.

NOTE: the filter param values need to be url-encoded

How to filter based on datetime

Use Case: Get profiles that have been updated between two datetimes.

How to use pagination and the page[size] param

Use Case: Use cursor-based pagination to get the next 20 profile records.

NOTE: This page cursor value is exactly what is returned in the self/next/prev response values

How to add additional information to your API response via additional-fields and the includes parameter

Use Case: Get a specific profile, return an additional predictive analytics field, and also return the list objects associated with the profile.

How to use our relationship endpoints to see related resources

Use Case: Get all list memberships for a profile with the given profile_id.

How to see what Klaviyo objects are associated with a specific tag

Use Case: Get all campaigns associated with the given tag_id.

Uploading Image From File

When using Images.uploadImageFromFile(file, name=name), `file`` can be either a file path string OR a bytearray.

NOTE: when file is a bytearray, you will need to use the optional name parameter to specify the file name, else name will default to unnamed_image_from_python_sdk

as a file path

as a bytearray

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:

Important Notes

Comprehensive list of Operations & Parameters

Accounts

Get Account

Get Accounts

Campaigns

Create Campaign

Create Campaign Clone

Assign Campaign Message Template

Create Campaign Recipient Estimation Job

Create Campaign Send Job

Delete Campaign

Get Campaign

Get Campaign Campaign Messages

Get Campaign Message

Get Campaign Message Campaign

Get Campaign Message Relationships Campaign

Get Campaign Message Relationships Template

Get Campaign Message Template

Get Campaign Recipient Estimation

Get Campaign Recipient Estimation Job

Get Campaign Relationships Campaign Messages

Get Campaign Relationships Tags

Get Campaign Send Job

Get Campaign Tags

Get Campaigns

Update Campaign

Update Campaign Message

Update Campaign Send Job

Catalogs

Create Back In Stock Subscription

Create Catalog Category

Create Catalog Category Relationships Items

Create Catalog Item

Create Catalog Item Relationships Categories

Create Catalog Variant

Delete Catalog Category

Delete Catalog Category Relationships Items

Delete Catalog Item

Delete Catalog Item Relationships Categories

Delete Catalog Variant

Get Catalog Categories

Get Catalog Category

Get Catalog Category Items

Get Catalog Category Relationships Items

Get Catalog Item

Get Catalog Item Categories

Get Catalog Item Relationships Categories

Get Catalog Item Variants

Get Catalog Items

Get Catalog Variant

Get Catalog Variants

Get Create Categories Job

Get Create Categories Jobs

Get Create Items Job

Get Create Items Jobs

Get Create Variants Job

Get Create Variants Jobs

Get Delete Categories Job

Get Delete Categories Jobs

Get Delete Items Job

Get Delete Items Jobs

Get Delete Variants Job

Get Delete Variants Jobs

Get Update Categories Job

Get Update Categories Jobs

Get Update Items Job

Get Update Items Jobs

Get Update Variants Job

Get Update Variants Jobs

Spawn Create Categories Job

Spawn Create Items Job

Spawn Create Variants Job

Spawn Delete Categories Job

Spawn Delete Items Job

Spawn Delete Variants Job

Spawn Update Categories Job

Spawn Update Items Job

Spawn Update Variants Job

Update Catalog Category

Update Catalog Category Relationships Items

Update Catalog Item

Update Catalog Item Relationships Categories

Update Catalog Variant

Coupons

Create Coupon

Create Coupon Code

Delete Coupon

Delete Coupon Code

Get Coupon

Get Coupon Code

Get Coupon Code Bulk Create Job

Get Coupon Code Bulk Create Jobs

Get Coupon Code Relationships Coupon

Get Coupon Codes

Get Coupon Codes For Coupon

Get Coupon For Coupon Code

Get Coupon Relationships Coupon Codes

Get Coupons

Spawn Coupon Code Bulk Create Job

Update Coupon

Update Coupon Code

DataPrivacy

Request Profile Deletion

Events

Create Event

Get Event

Get Event Metric

Get Event Profile

Get Event Relationships Metric

Get Event Relationships Profile

Get Events

Flows

Get Flow

Get Flow Action

Get Flow For Flow Action

Get Flow Action Messages

Get Flow Action Relationships Flow

Get Flow Action Relationships Messages

Get Flow Flow Actions

Get Flow Message

Get Flow Action For Message

Get Flow Message Relationships Action

Get Flow Message Relationships Template

Get Flow Message Template

Get Flow Relationships Flow Actions

Get Flow Relationships Tags

Get Flow Tags

Get Flows

Update Flow Status

Images

Get Image

Get Images

Update Image

Upload Image From File

Upload Image From URL

Lists

Create List

Add Profile To List

Delete List

Remove Profile From List

Get List

Get List Profiles

Get List Relationships Profiles

Get List Relationships Tags

Get List Tags

Get Lists

Update List

Metrics

Get Metric

Get Metrics

Query Metric Aggregates

Profiles

Create or Update Profile

Create Profile

Create or Update Push Token

Get Bulk Profile Import Job

Get Bulk Profile Import Job Errors

Get Bulk Profile Import Job Lists

Get Bulk Profile Import Job Profiles

Get Bulk Profile Import Job Relationships Lists

Get Bulk Profile Import Job Relationships Profiles

Get Bulk Profile Import Jobs

Get Profile

Get Profile Lists

Get Profile Relationships Lists

Get Profile Relationships Segments

Get Profile Segments

Get Profiles

Merge Profiles

Spawn Bulk Profile Import Job

Subscribe Profiles

Suppress Profiles

Unsubscribe Profiles

Unsuppress Profiles

Update Profile

Reporting

Query Campaign Values

Query Flow Series

Query Flow Values

Segments

Get Segment

Get Segment Profiles

Get Segment Relationships Profiles

Get Segment Relationships Tags

Get Segment Tags

Get Segments

Update Segment

Tags

Create Tag

Create Tag Group

Create Tag Relationships Campaigns

Create Tag Relationships Flows

Create Tag Relationships Lists

Create Tag Relationships Segments

Delete Tag

Delete Tag Group

Delete Tag Relationships Campaigns

Delete Tag Relationships Flows

Delete Tag Relationships Lists

Delete Tag Relationships Segments

Get Tag

Get Tag Group

Get Tag Group Relationships Tags

Get Tag Group Tags

Get Tag Groups


## Keyword Arguments

# $fields_tag_group | string[]
# $filter | string
# $page_cursor | string
# $sort | string

$klaviyo->Tags->getTagGroups($fields_tag_group=$fields_tag_group, $filter=$filter, $page_cursor=$page_cursor, $sort=$sort);

Get Tag Relationships Campaigns

## Positional Arguments

# $id | string

$klaviyo->Tags->getTagRelationshipsCampaigns($id);

Get Tag Relationships Flows

## Positional Arguments

# $id | string

$klaviyo->Tags->getTagRelationshipsFlows($id);

Get Tag Relationships Lists

## Positional Arguments

# $id | string

$klaviyo->Tags->getTagRelationshipsLists($id);

Get Tag Relationships Segments

## Positional Arguments

# $id | string

$klaviyo->Tags->getTagRelationshipsSegments($id);

Get Tag Relationships Tag Group

## Positional Arguments

# $id | string

$klaviyo->Tags->getTagRelationshipsTagGroup($id);

Get Tag Tag Group

## Positional Arguments

# $id | string

## Keyword Arguments

# $fields_tag_group | string[]

$klaviyo->Tags->getTagTagGroup($id, $fields_tag_group=$fields_tag_group);

Get Tags


## Keyword Arguments

# $fields_tag_group | string[]
# $fields_tag | string[]
# $filter | string
# $include | string[]
# $page_cursor | string
# $sort | string

$klaviyo->Tags->getTags($fields_tag_group=$fields_tag_group, $fields_tag=$fields_tag, $filter=$filter, $include=$include, $page_cursor=$page_cursor, $sort=$sort);

Update Tag

## Positional Arguments

# $id | string
# $body | associative array

$klaviyo->Tags->updateTag($id, $body);

Update Tag Group

## Positional Arguments

# $id | string
# $body | associative array

$klaviyo->Tags->updateTagGroup($id, $body);

Templates

Create Template

## Positional Arguments

# $body | associative array

$klaviyo->Templates->createTemplate($body);

Create Template Clone

## Positional Arguments

# $body | associative array

$klaviyo->Templates->createTemplateClone($body);

Create Template Render

## Positional Arguments

# $body | associative array

$klaviyo->Templates->createTemplateRender($body);

Delete Template

## Positional Arguments

# $id | string

$klaviyo->Templates->deleteTemplate($id);

Get Template

## Positional Arguments

# $id | string

## Keyword Arguments

# $fields_template | string[]

$klaviyo->Templates->getTemplate($id, $fields_template=$fields_template);

Get Templates


## Keyword Arguments

# $fields_template | string[]
# $filter | string
# $page_cursor | string
# $sort | string

$klaviyo->Templates->getTemplates($fields_template=$fields_template, $filter=$filter, $page_cursor=$page_cursor, $sort=$sort);

Update Template

## Positional Arguments

# $id | string
# $body | associative array

$klaviyo->Templates->updateTemplate($id, $body);

Appendix

Global Keyword args

NOTES:

We currently support the following global keyword args:

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).

Parameters & Arguments

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. $api_key is optional, as it is set at client level. However, you can override the client key wherever by passing in $api_key as the LAST optional param. Reminder: don't do this client-side.

All versions of api with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4 || ^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/api contains the following files

Loading the files please wait ....