2017 © Pedro Peláez
 

library webhooker-sdk

SDK for communicating with the WebHooker.io API

image

webhooker/webhooker-sdk

SDK for communicating with the WebHooker.io API

  • Wednesday, August 31, 2016
  • by danharper
  • Repository
  • 5 Watchers
  • 0 Stars
  • 203 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 8 Versions
  • 1 % Grown

The README.md

WebHooker SDK for PHP

Latest Version on Packagist ![Software License][ico-license] Build Status ![Total Downloads][ico-downloads], (*1)

Interact with the WebHooker.io API, (*2)

Install

Via Composer, (*3)

composer require webhooker/webhooker-sdk

You must also have Guzzle installed. By default, the package is only compatible with Guzzle 6:, (*4)

composer require guzzlehttp/guzzle

Usage

Instantiate:, (*5)

$webhooker = Webhooker\Webhooker::usingGuzzle('YOUR-API-KEY');

Add a subscriber:, (*6)

$subscriber = $webhooker->addSubscriber('Their Name Here');

$subscriber->id;

Add an endpoint for the subscriber to receive messages:, (*7)

// you can use "jsonSubscription" or "xmlSubscription"
$subscription = $webhooker->subscriber($id)->jsonSubscription($tenantKey, $deliveryUrl, $secret)->save();
$subscription = $webhooker->subscriber($id)->xmlSubscription($tenantKey, $deliveryUrl, $secret)->save();

// additional options for a subscription, e.g. Basic Auth, or "Legacy Payloads"
$subscription = $webhooker->subscriber($id)
  ->jsonSubscription($tenantKey, $deliveryUrl, $secret)
  ->basicAuth($username, $password)
  ->legacyPayload('p_reply')
  ->save();

$subscription->id;

Send a JSON message:, (*8)

// $jsonData can be something JSON-able (array/object) or a pre-encoded JSON string
$webhooker->notify('account-1', 'something.happened')->json($jsonData)->send();

Or, because JSON is very common, just pass it directly to the send() method:, (*9)

$webhooker->notify('account-1', 'something.happened')->send($jsonData);

Send an XML message:, (*10)

// $xmlData must be an XML string
$webhooker->notify('account-1', 'something.happened')->xml($xmlData)->send();

Send both XML and JSON messages:, (*11)

$webhooker->notify('account-1', 'something.happened')->xml($xmlData)->json($jsonData)->send();

Change log

Please see CHANGELOG for more information what has changed recently., (*12)

Testing

composer test

Contributing

Please see CONTRIBUTING and CONDUCT for details., (*13)

Security

If you discover any security related issues, please email dan@radweb.co.uk instead of using the issue tracker., (*14)

License

The MIT License (MIT). Please see License File for more information., (*15)

The Versions

31/08 2016

dev-master

9999999-dev https://github.com/webhooker/webhooker-sdk-php

SDK for communicating with the WebHooker.io API

  Sources   Download

MIT

The Requires

 

The Development Requires

webhooks webhooker webhooker-sdk

31/08 2016

0.2.2

0.2.2.0 https://github.com/webhooker/webhooker-sdk-php

SDK for communicating with the WebHooker.io API

  Sources   Download

MIT

The Requires

 

The Development Requires

webhooks webhooker webhooker-sdk

27/01 2016

0.2.1

0.2.1.0 https://github.com/webhooker/webhooker-sdk-php

SDK for communicating with the WebHooker.io API

  Sources   Download

MIT

The Requires

 

The Development Requires

webhooks webhooker webhooker-sdk

26/01 2016

dev-analysis-XVrB7P

dev-analysis-XVrB7P https://github.com/webhooker/webhooker-sdk-php

SDK for communicating with the WebHooker.io API

  Sources   Download

MIT

The Requires

 

The Development Requires

webhooks webhooker webhooker-sdk

26/01 2016

dev-analysis-zOM39J

dev-analysis-zOM39J https://github.com/webhooker/webhooker-sdk-php

SDK for communicating with the WebHooker.io API

  Sources   Download

MIT

The Requires

 

The Development Requires

webhooks webhooker webhooker-sdk

26/01 2016

0.2.0

0.2.0.0 https://github.com/webhooker/webhooker-sdk-php

SDK for communicating with the WebHooker.io API

  Sources   Download

MIT

The Requires

 

The Development Requires

webhooks webhooker webhooker-sdk

26/01 2016

dev-analysis-qrdraV

dev-analysis-qrdraV https://github.com/webhooker/webhooker-sdk-php

SDK for communicating with the WebHooker.io API

  Sources   Download

MIT

The Requires

 

The Development Requires

webhooks webhooker webhooker-sdk

20/01 2016

0.1.0

0.1.0.0 https://github.com/webhooker/webhooker-sdk-php

SDK for communicating with the WebHooker.io API

  Sources   Download

MIT

The Requires

 

The Development Requires

webhooks webhooker webhooker-sdk