Excel Add-In for Bitbucket

Build 24.0.9175

接続の確立

接続プロファイルの設定

[CData]リボンから[データの取得]をクリックし、[取得元:Bitbucket]> 設定済みの接続 を選択してCData クエリウィンドウを起動します。新しい接続を設定するには、[新しいBitbucket 接続]をクリックします。ここでは、接続の設定、接続のテスト、および接続プロファイルの保存を行うことができます。

Connecting to Bitbucket

For most queries, you must set the Workspace. The only exception to this is the Workspaces table, which does not require this property to be set, as querying it provides a list of workspace slugs that can be used to set Workspace. To query this table, you must set Schema to 'Information' and execute the query 'SELECT * FROM Workspaces'.

Setting Schema to 'Information' displays general information. To connect to Bitbucket, set these parameters:

  • Schema: To show general information about a workspace, such as its users, repositories, and projects, set this to Information. Otherwise, set this to the schema of the repository or project you are querying. To get a full set of available schemas, query the sys_schemas table.
  • Workspace: Required if you are not querying the Workspaces table. This property is not required for querying the Workspaces table, as that query only returns a list of workspace slugs that can be used to set Workspace.
    To query the Workspaces table, set Schema to Information and execute:
    SELECT * FROM Workspace

Authenticating to Bitbucket

Bitbucket supports OAuth authentication only. To enable this authentication from all OAuth flows, you must create a custom OAuth application, and set AuthScheme to OAuth.

The following subsections describe how to authenticate to Bitbucket from three common authentication flows.

For information about how to create a custom OAuth application, see Creating a Custom OAuth Application.

For a complete list of connection string properties available in Bitbucket, see Connection.

Desktop Applications

To connect via a desktop application, you must set and refresh the OAuth acess token.

Get and Refresh the OAuth Access Token

After setting the following, you are ready to connect:

  • OAuthClientId: The Key displayed when you created your custom OAuth application.
  • OAuthClientSecret: The Secret displayed when you created your custom OAuth application.
  • CallbackURL: The Callback URL defined when you registered your application. This is typically set to http://localhost:33333.

When you connect, the 本製品 opens Bitbucket's OAuth endpoint in your default browser. Log in and grant permissions to the application.

When the access token expires, the 本製品 refreshes it automatically.

Automatic Refresh of the OAuth Access Token

To have the 本製品 automatically refresh the OAuth access token:

  1. Before connecting to data for the first time, set these connection parameters:

  2. On subsequent data connections, set:

Manual refresh of the OAuth access token:

The only value needed to manually refresh the OAuth access token is the OAuth refresh token.

  1. To manually refresh the OAuthAccessToken after the ExpiresIn period (returned by GetOAuthAccessToken) has elapsed, call the RefreshOAuthAccessToken stored procedure.
  2. Set these connection properties:

    • OAuthClientId: The Client Id in your custom OAuth application settings.
    • OAuthClientSecret: The Client Secret in your custom OAuth application settings.

  3. Call RefreshOAuthAccessToken with OAuthRefreshToken set to the OAuth refresh token returned by GetOAuthAccessToken.
  4. After the new tokens have been retrieved, set the OAuthAccessToken property to the value returned by RefreshOAuthAccessToken. This opens a new connection.

Store the OAuth refresh token so that you can use it to manually refresh the OAuth access token after it has expired.

接続プロパティ

最後に、Connection プロパティを参照してください。接続の確立に使用できるさまざまなオプションの説明があります。

接続の管理

Bitbucket への認証に成功すると、インポートするデータをカスタマイズすることができます。詳しくは、接続の管理 を参照してください。

関連項目

  • データのクエリ:[データ選択]ウィザードを使用してスプレッドシートにデータをプルします。また、ここではスケジュールされたデータのリフレッシュも設定できます。
  • Excel アドインの使用:利用可能なCData Excel 関数 を使用するなど、Bitbucket データとやり取りする他の方法が見つかります。

Copyright (c) 2025 CData Software, Inc. - All rights reserved.
Build 24.0.9175