Accounts: get

認証が必要です

GTM アカウントを取得します。 今すぐ試すまたは例を見る

リクエスト

HTTP リクエスト

GET https://www.googleapis.com/tagmanager/v1/accounts/accountId

パラメータ

パラメータ名 説明
パスパラメータ
accountId string GTM アカウント ID。

承認

このリクエストは、少なくとも次のうち 1 つのスコープでの承認が必要です(認証と承認の詳細をご確認ください)。

範囲
https://www.googleapis.com/auth/tagmanager.readonly
https://www.googleapis.com/auth/tagmanager.manage.accounts
https://www.googleapis.com/auth/tagmanager.edit.containers

リクエスト本文

このメソッドをリクエストの本文に含めないでください。

レスポンス

成功した場合、このメソッドが返すレスポンスの本文に Accounts リソースが含まれています。

注: このメソッドで使用可能なコード例では、サポートされているプログラミング言語すべての例を示しているわけではありません(サポートされている言語の一覧については、クライアント ライブラリ ページをご覧ください)。

Java

Java クライアント ライブラリを使用します。

/*
 * Note: This code assumes you have an authorized tagmanager service object.
 */

/*
 * This request gets an existing account for the authorized user.
 */
try {
  Account account = tagmanager.accounts().get("123456").execute();
} catch (GoogleJsonResponseException e) {
  System.err.println("There was a service error: "
      + e.getDetails().getCode() + " : "
      + e.getDetails().getMessage());
}

Python

Python クライアント ライブラリを使用します。

# Note: This code assumes you have an authorized tagmanager service object.

# This request gets an existing account for the authorized user.
try:
  account = tagmanager.accounts().get(accountId='123456').execute()
except TypeError, error:
  # Handle errors in constructing a query.
  print 'There was an error in constructing your query : %s' % error

except HttpError, error:
  # Handle API errors.
  print dir(error)
  print ('There was an API error : %s : %s' %
         (error.resp.status, error.resp.reason))

試してみよう:

以下の API Explorer を使用して、ライブデータに対してこのメソッドを呼び出し、レスポンスを確認してください。