PHP Bitbucket API

Simple Bitbucket API wrapper for PHP

Users OAuth

Use the oauth resource to create and maintain your own OAuth consumers.

Prepare:

// @see: https://bitbucket.org/account/user/<username or team>/api
$oauth_params = array(
    'client_id'         => 'aaa',
    'client_secret'     => 'bbb'
);

$user = new \Bitbucket\API\Users();
$user->getClient()->addListener(
    new \Bitbucket\API\Http\Listener\OAuth2Listener($oauth_params)
);

Get all OAuth consumers:

$users->oauth()->all($account_name);

Create new consumer

$users->oauth()->create($account_name, 'test', 'just for testing', 'http://test.example.com/oauth/bitbucket');

Update existing consumer

$users->oauth()->create($account_name, 'test', 22, 'just for testing', 'http://test.example.com/oauth/bitbucket');

Delete existing consumer

$users->oauth()->delete($account_name, 22);