2017 © Pedro Peláez
 

library yo-dev-php-sdk

Yo PHP SDK is the official SDK wrapper for the Yopify Yo API service

image

yopify/yo-dev-php-sdk

Yo PHP SDK is the official SDK wrapper for the Yopify Yo API service

  • Monday, October 10, 2016
  • by yopify
  • Repository
  • 0 Watchers
  • 0 Stars
  • 12 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Yo PHP SDK

Yo PHP SDK is the official SDK wrapper for the Yo API service, (*1)

Requirements

  • PHP Version 5.3.0+

Installation

Install the latest version with, (*2)

$ composer require yopify/yo-dev-php-sdk

Manual User Installation

Download src/Yo/Client.php and include the file in your PHP project., (*3)

Check out our examples in example/example.php, quick usage examples:, (*4)

Basic Usage

Initialize Yo client via:, (*5)

<?php
use Yopify\Yo\Client;
$client = new Client();

$yoClient->authToken = 'YOUR-TOKEN-HERE'; // auth token can be found here: https://local.yopify.com/settings#/api

// OR

$yoClient->setBasicAuth('me@mysite.com', 'secret'); // You can use basic auth also
To check authentication:
$isAuthenticated = $yoClient->ping(); // false if not authenticated, current timestamp if success

Get a single Event
$event = $yoClient->getEvent(EVENT_ID);
Get list of events
$events = $client->getEvents(10, 1);

// Check for success
if (isset($events->meta)) {
    echo 'Current page: ', $events->meta->pagination->current_page, "\n";
    echo 'Total pages: ', $events->meta->pagination->total_pages, "\n";
    echo 'Page page: ', $events->meta->pagination->per_page, "\n";
    echo 'Total count: ', $events->meta->pagination->total, "\n";
}
Create new event
$event = new Yopify\Yo\YoEvent();
$event->event_type_id = '1';
$event->unique_id1 = '10';
$event->unique_id2 = '1';
$event->title = 'This awesome product';
$event->first_name = 'Jon';
$event->last_name = 'snow';
$event->city = 'New York';
$event->province = 'XXXX';
$event->country = 'USA';
$event->url = 'https://example.com';
$event->message_template = '[FIRST-NAME] from [COUNTRY] just purchased [TITLE-WITH-LINK]';
$YoEvent = $yoClient->createEvent($event);
Update an event
$YoEvent = $yoClient->getEvent(EVENT_ID);

if (isset($YoEvent->data)) {
    $YoEvent = $YoEvent->data;
    $YoEvent->province = "AAAA";

    $updatedEvent = $yoClient->updateEvent($YoEvent);
}
Delete an event:
$deletedEvent = $yoClient->deleteEvent(20);

Support

If you have questions, email us at yo@yopify.com., (*6)

The Versions

10/10 2016

dev-master

9999999-dev https://local.yopify.com

Yo PHP SDK is the official SDK wrapper for the Yopify Yo API service

  Sources   Download

proprietary

The Requires

  • php >=5.3.0

 

by Yo

api wrapper notifications yo social proof recent events boost sales

10/10 2016

1.0.0

1.0.0.0 https://local.yopify.com

Yo PHP SDK is the official SDK wrapper for the Yopify Yo API service

  Sources   Download

proprietary

The Requires

  • php >=5.3.0

 

by Yo

api wrapper notifications yo social proof recent events boost sales