Code Monkey home page Code Monkey logo

client's Introduction

Bitbucket API Client

We present a modern Bitbucket API 2.0 client, by Graham Campbell.

Banner

This is strongly based on php-github-api by KnpLabs. With this in mind, we now have very similar clients for:

Installation

This version requires PHP 7.1-7.4.

To get the latest version, simply require the project using Composer. You will need to install any package that "provides" php-http/client-implementation. Most users will want:

$ composer require bitbucket/client php-http/guzzle6-adapter:^2.0

There is also a Laravel bridge for this package: graham-campbell/bitbucket.

Usage

The main point of entry is the Bitbucket\Client class. Simply create a new instance of that, and you're good to go!

Practically, you will also want to set authentication details before calling any of the endpoint, however, this is not required to call endpoints for which authentication is not needed. We support logging in with an OAuth2 token, or with a username and password.

<?php

use Bitbucket\Client;

$c = new Client();

$c->authenticate(Client::AUTH_OAUTH_TOKEN, 'your-token-here');
// $c->authenticate(Client::AUTH_HTTP_PASSWORD, 'your-username', 'your-password');

var_dump($c->currentUser()->show());

As of time of writing (Saturday 29th June 2019), every endpoint (excluding issue export and import) available on the Bitbucket API 2.0 is also available through this PHP client. I'd recommend looking through the Bitbucket documentation, and also the generated documentation.

Security

If you discover a security vulnerability within this package, please send an email to Graham Campbell at [email protected]. All security vulnerabilities will be promptly addressed. You may view our full security policy here.

License

Bitbucket API Client is licensed under The MIT License (MIT).

client's People

Contributors

grahamcampbell avatar hadjedjvincent avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.