madnesscode/voluum

Voluum SDK for PHP

1.2 2017-09-21 17:09 UTC

This package is auto-updated.

Last update: 2024-05-19 15:41:41 UTC


README

Build Status Latest Stable Version Total Downloads License

This repository contains the open source PHP SDK that allows you to access the Voluum REST API

Installation

The Voluum PHP SDK can be installed with Composer. Run this command:

composer require madnesscode/voluum

Usage

Note: This version of the Voluum SDK for PHP requires PHP 5.6 or greater.

Example

use MadnessCODE\Voluum;

Use voluum account email and password for credentials:

$email = 'test@example.com';
$password = 'test';

$client = new Voluum\Client\API(new Voluum\Auth\PasswordCredentials($email, $password));

$report_api = new Voluum\API($client);

Or use access id and key:

$access_key_id = "access_key_id";
$access_key = "access_key";

$client = new Voluum\Client\API(new Voluum\Auth\AccessKeyCredentials($access_key_id, $access_key));

$report_api = new Voluum\API($client);

How to get report:

$result = $report_api->get("report", [
   "from" => date("Y-m-d"),
   "to" => date("Y-m-d"),
   "groupBy" => "campaign"
]);

//Get result as json
echo $result->getJson();

//Get result as object
var_dump($result->getData());

Create new lander:

$result = $report_api->post("lander", [
   "namePostfix" => "Test",
   "url" => "http://example.com"
]);

Edit lander:

$result = $report_api->put("lander/xxxxx-xxxxxx-xxxxxx-xxxxx", [
   "namePostfix" => "Test 1",
   "url" => "http://example.com"
]);

Delete lander:

$result = $report_api->delete("lander", [
   "ids" => "xxxxx-xxxxxx-xxxxxx-xxxxxx"
]);

Upload conversion:

$result = $report_api->csv("conversion", 
    "POST", 
    "c384EFV6JHQODRN70575OK6,1.2,abc123,app_install");

Complete documentation is available here.

License

Please see the license file for more information.