Skip to content

Instantly share code, notes, and snippets.

@harrygr
Created November 8, 2016 10:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save harrygr/8ae3e4c9ee988275788e753644d86cd6 to your computer and use it in GitHub Desktop.
Save harrygr/8ae3e4c9ee988275788e753644d86cd6 to your computer and use it in GitHub Desktop.
<?php
$stack = HandlerStack::create();
$middleware = new Oauth1([
'consumer_key' => config('services.xero.key'),
'consumer_secret' => config('services.xero.secret'),
]);
$stack->push($middleware);
$client = new Client([
'base_uri' => 'https://api.xero.com/api.xro/2.0/',
'handler' => $stack,
]);
$res = $client->request('GET', 'Contacts');
var_dump($res);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment