Download the PHP package zaius/zaius-php-sdk without Composer

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

Zaius SDK for PHP

Getting Started

The Zaius SDK provides a programmatic interface for the Zaius API as documented at https://developers.zaius.com/reference .

To get started, include the library in your project:

You can get an instance of the Zaius client using:

The API key can be obtained from your Zaius account at https://app.zaius.com/app#/api_management . Click on the "Private" tab and use the private API key.

Available methods

Customer management

Create/update a customer

The method takes in a single array with the customer object or an array of customer objects

Example:

Get a customer

This method takes in a filter array with the following possible keys:

Note that you need to pass only one of the above. Also, the API supports only exact matches for each field.

Example:

Events

Post an event

Posts an event. The event array object method must have the following keys:

You can pass an array of events for bulk upload.

Example:

List management

Create a list

Creates a list with the given name.

Example:

Get all lists

Returns all lists.

Example:

Update a list

Updates a list's name. The method expects the following parameters:

Example:

Subscription management

Get subscriptions

Gets subscriptions based on a filter. The lists of accepted filters is available at https://developers.zaius.com/reference#get-subscriptions-1 .

Example:

Update subscription

Updates a subscription. The subscription array can have three keys:

The method also supports passing an array of subscriptions for bulk updates.

Example:

Update channel opt-in

Updates a subscription. Parameters:

Example:

Exports

Export all objects

Exports all objects. Parameters:

Example:

Export filtered objects

Export objects given a filter.

Parameters:

Example:

Get the export status

Gets the status of an export. Parameters:

Example:

Schema API

Get all available objects

Returns an array with all available objects schemas.

Example:

Get object schema

Returns the schema for the specified object.

Parameters:

Example:

Create a new object type

Creates a new object type. Parameters:

Example:

Get an object's fields

Gets the fields for an object. Parameters:

Example:

Create a new field for an object

Creates a new field for an object. Parameters:

Example:

Get all object's relations

Gets all relations for an object. Parameters:

Example:

Posting objects

Post a product

This method also supports passing an array of products for bulk updates.

Post a customer

This method also supports passing an array of customers for bulk updates.

Post an order

This method also supports passing an array of orders for bulk updates.

Posting custom objects

Creates (or updates) an object. Parameters:

This method supports passing an array of objects for bulk updates.

Example:

Bulk upload objects to S3

The S3 client can be obtained from the Zaius Client:

To get the needed keys, check https://developers.zaius.com/v3/reference#amazon-s3

Events

Products

Customers

Orders

Supported object types

All Zaius methods expect arrays in a specific format. Besides the keys listed for each object, any other key/value pair is accepted and will be sent as a custom field, if it was defined via the Zaius dashboard/schema API

To see the full list of available fields, access https://app.zaius.com/app#/custom_fields after logging in into your Zaius account.

Customers

Key Type Other details
email string
gender string
name string
first_name string
last_name string
phone string
timezone string The timezone of the user in the following format: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
street1 string
street2 string
city string
state string
zip string
country string
image_url string
customer_id string

Example:

Events

Key Type Other details
type string
action string
identifiers.email string
identifiers.vuid string
data.ts integer Timestamp of the event in unix time (epoch time). Automatically set to now if not present.
data.product_id string
data.category string
data.channel string
data.ua string User agent
data.ip string
data.title string
data.hostname string
data.page string
data.source string
data.medium string
data.campaign string
data.content string
data.keywords string
data.language string
data.character_set string
data.days_since_last_visit integer
data.landing bool
data.referrer string
data.search_term string
data.filter_field string
data.filter_value string
data.sort_direction string
data.sort_field string

Example:

Products

Key Type Other details
brand string
category_id integer
description string
image_url string
is_in_stock bool
name string
parent_product_id integer
price number
product_id string
qty integer
sku string
special_price number
special_price_from_date timestamp
special_price_to_date timestamp
upc string

Example:

Orders

Key Type Other details
bill_address string
coupon_code string
first_name string
last_name string
name string
discount number
email string
order_id string
phone string
ship_address string
shipping number
status text
subtotal number
tax number
total number
user_id string
items.product_id string
items.sku string
items.quantity integer
items.subtotal number

Example:

Generic API calls

While the SDK covers all specific operations, it is possible to initiate a general call to the API by using the call() method. Three parameters are expected:

The method returns the raw API response. Note that most of the time, this will be a json encoded string.

The method throws a ZaiusException in case the response code is any other than 20x or 404. A 404 response code returns a null body and represents the fact that no entry was found for the provided query.

Example:

Batch processing

While the Zaius API is fast, it is possible to completely decouple it by using batch processing. We are making use of DJJob, https://github.com/seatgeek/djjob as a general queueing mechanism.

Setup

Initialize the mysql database:

Before making a call to push to the queue, you need to ensure that the mysql credentials were initialized:

Push events to the queue

All posting methods have a queue bool parameter that you can set to push to the queue instead of processing instantly:

The returned value from the post calls will be the mysql insert id of the pushed object.

You can later process the queue with:


All versions of zaius-php-sdk with dependencies

PHP Build Version
Package Version
Requires php Version >=5.5
aws/aws-sdk-php Version ^3.85
ext-curl Version *
ext-json Version *
seatgeek/djjob Version ^1.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 zaius/zaius-php-sdk contains the following files

Loading the files please wait ....