2017 © Pedro Peláez
 

library sailthru-php5-client

Sailthru PHP5 Client

image

sailthru/sailthru-php5-client

Sailthru PHP5 Client

  • Monday, June 11, 2018
  • by sailthru-noc
  • Repository
  • 67 Watchers
  • 38 Stars
  • 448,939 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 48 Forks
  • 5 Open issues
  • 25 Versions
  • 7 % Grown

The README.md

sailthru-php5-client

Build Status Coverage Status, (*1)

For installation instructions, documentation, and examples please visit: http://getstarted.sailthru.com/new-for-developers-overview/api-client-library/php5, (*2)

A simple client library to remotely access the Sailthru REST API as per http://getstarted.sailthru.com/developers/api, (*3)

By default, it will make request in JSON format., (*4)

Optional parameters for connection/read timeout settings

Increase timeout from 10 (default) to 30 seconds., (*5)

$client = new Sailthru_Client($this->api_key, $this->secret, $this->api_url, array('timeout' => 30000, 'connect_timeout' => 30000));

API Rate Limiting

Here is an example how to check rate limiting and throttle API calls based on that. For more information about Rate Limiting, see Sailthru Documentation, (*6)

// get last rate limit info
$rate_limit_info = $sailthru_client->getLastRateLimitInfo("user", "POST");

// getRateLimitInfo returns null if given endpoint/method wasn't triggered previously
if ($rate_limit_info) {
    $limit = $rate_limit_info['limit'];
    $remaining = $rate_limit_info['remaining'];
    $reset_timestamp = $rate_limit_info['reset'];

    // throttle api calls based on last rate limit info
    if ($remaining <= 0) {
        $seconds_till_reset = $reset_timestamp - time();

        // sleep or perform other business logic before next user api call
        sleep($seconds_till_reset);
    }
}

Tests

You can run the tests locally with:, (*7)

vendor/bin/phpunit

The Versions

11/06 2018

dev-CurlErrorPatch

dev-CurlErrorPatch http://github.com/sailthru/sailthru-php5-client

Sailthru PHP5 Client

  Sources   Download

MIT

The Development Requires

24/08 2017

2.0.x-dev

2.0.9999999.9999999-dev http://github.com/sailthru/sailthru-php5-client

Sailthru PHP5 Client

  Sources   Download

MIT

The Development Requires

16/08 2017

dev-AddVarsToListFunctions

dev-AddVarsToListFunctions http://github.com/sailthru/sailthru-php5-client

Sailthru PHP5 Client

  Sources   Download

MIT

The Development Requires

15/08 2017

dev-httpErrorHandling

dev-httpErrorHandling http://github.com/sailthru/sailthru-php5-client

Sailthru PHP5 Client

  Sources   Download

MIT

The Development Requires

09/08 2017

dev-RemoveEmailApi

dev-RemoveEmailApi http://github.com/sailthru/sailthru-php5-client

Sailthru PHP5 Client

  Sources   Download

MIT

The Development Requires

03/08 2017

dev-UpdateDocs

dev-UpdateDocs http://github.com/sailthru/sailthru-php5-client

Sailthru PHP5 Client

  Sources   Download

MIT

The Development Requires

02/08 2017

dev-master

9999999-dev http://github.com/sailthru/sailthru-php5-client

Sailthru PHP5 Client

  Sources   Download

MIT

The Development Requires

02/08 2017

dev-FixTravis

dev-FixTravis http://github.com/sailthru/sailthru-php5-client

Sailthru PHP5 Client

  Sources   Download

MIT

The Development Requires

27/01 2017

1.2.3

1.2.3.0 http://github.com/sailthru/sailthru-php5-client

Sailthru PHP5 Client

  Sources   Download

MIT

The Development Requires

27/01 2017

dev-develop

dev-develop http://github.com/sailthru/sailthru-php5-client

Sailthru PHP5 Client

  Sources   Download

MIT

The Development Requires

10/08 2016

1.2.2

1.2.2.0 http://github.com/sailthru/sailthru-php5-client

Sailthru PHP5 Client

  Sources   Download

MIT

02/08 2016

dev-timeouts

dev-timeouts http://github.com/sailthru/sailthru-php5-client

Sailthru PHP5 Client

  Sources   Download

MIT

11/05 2016

1.2.1

1.2.1.0 http://github.com/sailthru/sailthru-php5-client

Sailthru PHP5 Client

  Sources   Download

MIT

11/05 2016

dev-SRE-3501/SRE-3502

dev-SRE-3501/SRE-3502 http://github.com/sailthru/sailthru-php5-client

Sailthru PHP5 Client

  Sources   Download

MIT

05/05 2016

1.2.0

1.2.0.0 http://github.com/sailthru/sailthru-php5-client

Sailthru PHP5 Client

  Sources   Download

MIT

27/04 2015

dev-ES-57

dev-ES-57 http://github.com/sailthru/sailthru-php5-client

Sailthru PHP5 Client

  Sources   Download

MIT

16/07 2014

1.1.0

1.1.0.0 http://github.com/sailthru/sailthru-php5-client

Sailthru PHP5 Client

  Sources   Download

MIT

11/06 2014

dev-fix_unit_tests

dev-fix_unit_tests http://github.com/sailthru/sailthru-php5-client

Sailthru PHP5 Client

  Sources   Download

MIT

10/03 2014

dev-bug-11634

dev-bug-11634 http://github.com/sailthru/sailthru-php5-client

Sailthru PHP5 Client

  Sources   Download

MIT

04/10 2013

dev-bug-8349

dev-bug-8349 http://github.com/sailthru/sailthru-php5-client

Sailthru PHP5 Client

  Sources   Download

MIT

13/08 2013

dev-bug-7196

dev-bug-7196 http://github.com/sailthru/sailthru-php5-client

Sailthru PHP5 Client

  Sources   Download

MIT

27/06 2013

dev-bug-647

dev-bug-647 http://github.com/sailthru/sailthru-php5-client

Sailthru PHP5 Client

  Sources   Download

MIT

03/06 2013

dev-bug-6074

dev-bug-6074 http://github.com/sailthru/sailthru-php5-client

Sailthru PHP5 Client

  Sources   Download

MIT

10/04 2013

dev-bugz-5199

dev-bugz-5199 http://github.com/sailthru/sailthru-php5-client

Sailthru PHP5 Client

  Sources   Download

MIT

24/01 2013

dev-diagnostics

dev-diagnostics http://github.com/sailthru/sailthru-php5-client

Sailthru PHP5 Client

  Sources   Download

MIT