ballerinax/bitbucket Ballerina library



This is a generated connector for Bitbucket API v2.0 OpenAPI Specification.

Code against the Bitbucket API to automate simple tasks, embed Bitbucket data into your own site, build mobile or desktop apps, or even add custom UI add-ons into Bitbucket itself using the Connect framework.


Before using this connector in your Ballerina application, complete the following:

  • Create a BitBucket account
  • Obtain tokens
  1. Go to the Bitbucket account and navigate to your workspace.

  2. Then, Go to settings in the workspace.

  3. Select OAuth consumers from Apps and Features list.

  4. Create a new consumers and copy your key and secret.

  5. Use the following code to generate the refresh token. The full-blown 3-LO flow. Request authorization from the end user by sending their browser to:{client_id}&response_type=code

    The callback includes the ?code={} query parameter that you can swap for an access token:

    $ curl -X POST -u "client_id:secret" -d grant_type=authorization_code -d code={code}
  6. Use the following link as the refresh URL

  7. For more information, Refer this link


To use the BitBucket connector in your Ballerina application, update the .bal file as follows: Add steps to create a simple sample

Step 1 - Import connector

Import the ballerinax/bitbucket module into the Ballerina project.

import ballerinax/bitbucket;

Step 2 - Create a new connector instance

bitbucket:ClientConfig configuration = {
    auth: {
        clientId: "<Client Id>",
        clientSecret: "<Client Secret>",
        refreshUrl: "<Refresh Url>",
        refreshToken: "<Refresh Token>"

bitbucket:Client bitBucketClient = check new (clientConfig);

Step 3 - Invoke connector operation

  1. Invoke connector operations using the client
public function main() {
    bitbucket;Issue|error response = bitBucketClient->getIssueByID(issueId, repoWithIssueTracker, workspace);
  1. Use bal run command to compile and run the Ballerina program.


import ballerinax/bitbucket;Copy


Released date: about 2 years ago

Version: 1.2.0

License: Apache-2.0


Platform: any

Ballerina version: 2201.0.0

GraalVM compatible: Yes

Pull count

Total: 7

Current verison: 0

Weekly downloads


IT Operations/Source Control



Other versions

See more...