consumers Resource

Overview

A consumer is an application authorized to integrate with a Bitbucket account. Account owners or team administrators can give third-party web applications access to a Bitbucket individual account or a team.  By integrating an application with Bitbucket, you authorize that account to act as your user.  So, for example, if you have read/write access to all of the account, the application does as well.  Anything you could do when logged into Bitbucket, that application can also do.

As a consumer is associated with an account, all calls to retrieve consumer information require the caller to authenticate as an owner or administrator on the account.   A consumer instance has the following fields:

{
    "description": "", 
    "id": 22779, 
    "key": "y9spXwJKNcygKdWBH2", 
    "name": "TestDVCS", 
    "secret": "bQWTaGRpT9RhB24TQWYP9M2LcvZy9Pkw", 
    "url": ""
} 

These fields have the following values:

Field Description
description Description of this integration. This can be null.
id An identifier assigned by Bitbucket.
key An Oauth key generated by Bitbucket.
name Display name for the consumer.
secret An Oauth secret generated by Bitbucket.
url The URL for the consumer. This can be null.

GET a list of an account's consumers

Returns an array of consumers integrated with the account.

Parameter
Required?
Description
accountname Yes The team or individual account name.

GET https://api.bitbucket.org/1.0/users/{accountname}/consumers

  Click here to expand...
[
    {
        "description": "", 
        "id": 22779, 
        "key": "y9spXwJKNcygKdWBH2", 
        "name": "TestDVCS", 
        "secret": "bQWTaGRpT9RhB24TQWYP9M2LcvZy9Pkw", 
        "url": ""
    }, 
    {
        "description": "test", 
        "id": 27209, 
        "key": "wBLY2HU5yjcD4ncmLj", 
        "name": "test", 
        "secret": "Hw8TAqhpbPHhbBBCFyD8HPS4nm25EGZp", 
        "url": "www.slate.com"
    }
]

GET a consumer

Gets an individual consumer for an account.

Parameter
Required?
Description
accountname Yes The team or individual account name.
id Yes Identifier for the key

 GET https://api.bitbucket.org/1.0/users/{accountname}/{id}

  Click here to expand...
{
    "description": "", 
    "id": 22779, 
    "key": "y9spXwJKNcygKdWBH2", 
    "name": "TestDVCS", 
    "secret": "bQWTaGRpT9RhB24TQWYP9M2LcvZy9Pkw", 
    "url": ""
} 

PUT an updated consumer

Updates an individual consumer for an account.  You must supply the consumer's name parameter.

Parameter
Required?
Description
accountname Yes The team or individual account name.
id Yes Identifier for the key
name Yes Name of the consumer.
description No Description for the consumer.
url No The URL for the

 PUT https://api.bitbucket.org/1.0/users/{accountname}/{id} -d"name={name}&description={string}&url={url}"

  Click here to expand...
{
    "description": "here", 
    "id": 22774, 
    "key": "y6spXwJKNcygKdWBH2", 
    "name": "ralph", 
    "secret": "bQWTaGRpT9RhB24TQWYP9M2LcvZy6Pkw", 
    "url": "foobar.com"
}

DELETES a consumer

Deletes an individual consumer from an account.

Parameter
Required?
Description
accountname Yes The team or individual account name.
id Yes Identifier for the key

DELETE https://api.bitbucket.org/1.0/users/{accountname}/{id}

This call returns 204 No Content on success.

Was this helpful?

Thanks for your feedback!

Why was this unhelpful?

Have a question about this article?

See questions about this article

Powered by Confluence and Scroll Viewport