wirthhorn/daypaio

A simple PHP Daypaio API client

dev-master 2018-08-09 14:35 UTC

This package is not auto-updated.

Last update: 2025-06-17 21:32:23 UTC


README

A simple PHP client for the Daypaio API.

Requirements

PHP 7

CURL

Usage

Initialization

use Daypaio;

$daypaio = new Daypaio([
	'access_token' => 'Enter access token',
	'environment' => 'stage' // valid: stage, production
]);

List interestchannels

$daypaio->interestchannel->get();

List shops

$daypaio->shops->get();

Create a new consumer

$daypaio->consumer->post([
	"email" => "foo@bar.com",
  	"t" => "lead",
  	"first_name" => "foo",
  	"interestchannels" => [],
  	"preferredShop" => "",
  	"ext_id" => ""
]);

Search a consumer

$daypaio->query->get(
	["email" => "stuber@wirth-horn.de"], // search parameters
	["id", "email"] // fields to return
);

Delete an existing consumer

$daypaio->delete->post("consumer", "5b2a63c2d848af4cc12ecf44");

Tests

  1. Composer is a prerequisite for running the tests. Install composer globally, then run composer install to install required files.
  2. Create tests/DaypaioTestCredentials.php from tests/DaypaioTestCredentials.php.dist and edit it to add your access token.
  3. The tests can be executed by running this command from the root directory:
$ ./vendor/bin/phpunit