PHP Bitbucket API

Simple Bitbucket API wrapper for PHP

Services

Provides functionality for adding, removing, and configuring brokers on your repositories.

Prepare:

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

$services = new \Bitbucket\API\Repositories\Services();
$services->getClient()->addListener(
    new \Bitbucket\API\Http\Listener\OAuth2Listener($oauth_params)
);

Get a list of services on a repository:

$services->all($account_name, $repo_slug);

Get a single service attached to your repository:

$services->get($account_name, $repo_slug, 2);

Create a new service:

$services->create($account_name, $repo_slug, 'POST', array(
    'URL' => 'http://example.com/bb-hook'
));

Update a service:

$services->update($account_name, $repo_slug, 1, array(
    'URL' => 'https://example.com/bb-hook'
));

Delete a service:

$services->delete($account_name, $repo_slug, 1);