2017 © Pedro Peláez
 

library csapi-php

API client library to work with the Commerce Signals platform.

image

commercesignals/csapi-php

API client library to work with the Commerce Signals platform.

  • Tuesday, May 2, 2017
  • by commercesignals
  • Repository
  • 2 Watchers
  • 1 Stars
  • 7 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 1 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

Databridge by Commerce Signals, (*1)

Build Status License, (*2)

Library to interface with the Commerce Signals platform., (*3)

Installing with Composer

composer require commercesignals/csapi-php, (*4)

Usage

Authorize your client

const CERT_FILE_NAME = 'my-api-key-private-cert.pem';
const API_KEY = '0b70012a-5a7a-2b90-815a-aa73a7f8001a'; // My API Key
const API_BASE = 'https://api.commercesignals.com/';

$api = new CommerceSignals\API(API_BASE, [
  'apiKey' => API_KEY,
  'cert' => file_get_contents(__DIR__ . '/' . CERT_FILE_NAME)
]);

The API class

The main API class is used to build the API request to issue., (*5)

The methods of the API call can be chained to create the segments of the request you are making. Each chained method has an optional $id paramater that can be passed to request a specific resource from the segment part. The final method in the call determins the type of HTTP request being made and has an optional $payload paramater that will be used as the request BODY., (*6)

get() => GET request
update() => PATCH request
save() => POST or PUT (depending on if the payload BODY has an id set or not)
Example
  $api->signals('0a000337-574f-223e-8156-4f3a98e707a1')
    ->requests('0a00017c-5aac-1195-82ba-ae6ea3fa000a')
    ->results()
    ->get();
HTTP Request

GET https://api.commercesignals.com/rest/v1/signals/0a00...07a1/requests/0a00...a000a/results, (*7)

Calling Endpoint Examples

The Versions

02/05 2017

dev-master

9999999-dev

API client library to work with the Commerce Signals platform.

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.6

 

The Development Requires

api library

02/05 2017

v0.0.2

0.0.2.0

API client library to work with the Commerce Signals platform.

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.6

 

The Development Requires

api library

25/04 2017

dev-feature/submit_signals

dev-feature/submit_signals

API client library to work with the Commerce Signals platform.

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.6

 

The Development Requires

api library

17/03 2017

v0.0.1

0.0.1.0

API client library to work with the Commerce Signals platform.

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.4

 

The Development Requires

api library