2017 © Pedro Peláez
 

library optimove

Optimove API Client

image

genesis-global/optimove

Optimove API Client

  • Monday, January 2, 2017
  • by SiliconMind
  • Repository
  • 4 Watchers
  • 0 Stars
  • 1 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Optimove

PHP Optimove API client., (*1)

Requirements

  • PHP 7
  • Curl

Implemented API calls:

  • general/login
  • integrations/AddPromotions
  • integrations/GetPromotions
  • integrations/DeletePromotions

Example

 "WB23", "PromotionName" => "Welcome back Promo"}],
  ["PromoCode" => "NV10", "PromotionName" => "New VIP 10% Discount"]
];
$client->promotions()->AddPromotions($promotions);

?>

Reference

Client object has methods which returns objects for specific API parts. Client's available methods: - general() - returns object for general/* calls - promotions() - returns object for promotions/* calls, (*2)

Client

This is main object which contains all methods which you need to use Optimove API., (*3)

__construct(string $username, string $password)

Client constructor require following arguments: - string $username - Optimove account username - string $password - Optimove account password, (*4)

Example:
<?php
use GenesisGlobal\Optimove\Client;

$username = 'foo';
$password = 'password';
$client = new Client($username, $password);

general() :General

Method returns General object., (*5)

Example:
<?php
use GenesisGlobal\Optimove\Client;

$username = 'foo';
$password = 'password';
$client = new Client($username, $password);

$general = $client->general();

promotions() :Promotions

Method returns Promotions object., (*6)

Example:
<?php
use GenesisGlobal\Optimove\Client;

$username = 'foo';
$password = 'password';
$client = new Client($username, $password);

$promotions = $client->promotions();

General

To retrieve General object you should call method general() from Client object., (*7)

login(string $username, string $password)

Method login Client to Optimove API. This method is auto executed durning creating Client instance., (*8)

Parameters
  • string $username - Optimove account username
  • string $password - Optimove account password
Example:
<?php
use GenesisGlobal\Optimove\Client;

$username = 'foo';
$password = 'password';
$client = new Client($username, $password);

$newUser = 'bar';
$newPassword = 'secret';
$client->general()->login($newUser, $newPassword);

Promotions

To retrieve Promotions object you need call method promotions() from Client object., (*9)

AddPromotions(array $promotions)

Adds promo codes and associated names that will be available for selection when running a campaign. There is no need to worry about Optimove limit to sending promo coded., (*10)

If you will send more than 100 promocodes in one call then method will chunk your data and will send your data using several API calls., (*11)

Parameters
  • array $promotions Array of promotions, each promotions should be array which has following keys
    • PromoCode
    • PromotionName
Example:
<?php
use GenesisGlobal\Optimove\Client;

$username = 'foo';
$password = 'password';
$client = new Client($username, $password);

$promotions = [
  ["PromoCode" => "WB23", "PromotionName" => "Welcome back Promo"}],
  ["PromoCode" => "NV10", "PromotionName" => "New VIP 10% Discount"]
];
$client->promotions()->AddPromotions($promotions);

GetPromotions()

Returns an array of all defined promo codes and associated names., (*12)

Parameters

None, (*13)

Example:
<?php
use GenesisGlobal\Optimove\Client;

$username = 'foo';
$password = 'password';
$client = new Client($username, $password);

$promotions = $client->promotions()->GetPromotions();

DeletePromotions(array $promotions)

Removes previously-added promo codes. There is no need to worry about Optimove limit to sending promo coded., (*14)

If you will send more than 100 promocodes in one call then method will chunk your data and will send your data using several API calls., (*15)

Parameters
  • array $promotions Array of promotions, each promotions should be array which has following keys
    • PromoCode
Example:
<?php
use GenesisGlobal\Optimove\Client;

$username = 'foo';
$password = 'password';
$client = new Client($username, $password);

$promotions = [
  ["PromoCode" => "WB23"],
  ["PromoCode" => "NV10"]
];
$client->promotions()->DeletePromotions($promotions);

The Versions

02/01 2017

dev-master

9999999-dev

Optimove API Client

  Sources   Download

MIT

The Requires

 

The Development Requires

by Genesis Global

02/01 2017

0.1

0.1.0.0

Optimove API Client

  Sources   Download

MIT

The Requires

 

The Development Requires

by Genesis Global