[null,null,["最后更新时间 (UTC):2025-08-29。"],[[["\u003cp\u003eThe Search Ads 360 Reporting API requires OAuth 2.0 application credentials, including a client ID, client secret, and refresh token, for authorization.\u003c/p\u003e\n"],["\u003cp\u003eYou can generate access tokens using these credentials and the \u003ccode\u003ecurl\u003c/code\u003e command-line tool for use in API calls.\u003c/p\u003e\n"],["\u003cp\u003eA \u003ccode\u003elogin-customer-id\u003c/code\u003e header is necessary when making API calls as a Search Ads 360 Manager Account to specify the manager's customer ID.\u003c/p\u003e\n"],["\u003cp\u003eAPI responses include a \u003ccode\u003erequest-id\u003c/code\u003e header, useful for debugging and troubleshooting with Google developer support.\u003c/p\u003e\n"]]],["OAuth 2.0 application credentials are required for Search Ads 360 Reporting API calls. Manager accounts must include a `login-customer-id` header, without hyphens, specifying their customer ID. Obtain a *client ID*, *client secret*, and *refresh token* to generate an access token via a `curl` command, then include this *access token* in the `Authorization` header of each API call. The `request-id` header, found in responses, uniquely identifies each API request.\n"],null,["# Authorization and HTTP Headers\n\nYou need OAuth 2.0 application credentials when calling the Search Ads 360 Reporting API. If you're making API calls as\na Search Ads 360 Manager Account, you also need to specify a [`login-customer-id`](/search-ads/reporting/concepts/login-customer-id) header\nwith each request. This page describes how to set these values and documents\nseveral additional API-specific HTTP headers that are sent and received when\nusing the REST interface.\n\nOAuth 2.0 credentials\n---------------------\n\nThe Search Ads 360 Reporting API uses *application credentials* for identifying and authorizing API\nrequests. OAuth 2.0 clients can be configured. All Search Ads 360 Reporting API calls must be authorized through OAuth2. OAuth2 enables your Search Ads 360 Reporting API client app to access a user's Search Ads 360 account without having to handle or store the user's login info.\n\nIf you are new to Google APIs, you can use\n[oauth2l](https://github.com/google/oauth2l) or the [OAuth 2.0\nPlayground](/search-ads/reporting/concepts/oauth-playground) to experiment with\napplication credentials and the Search Ads 360 Reporting API before writing the code for your\napp. You can also generate an OAuth refresh token by running the provided [user credential generation script](/search-ads/reporting/sample-code/generate-user-credentials).\n\n### Generating new access tokens\n\nOnce you have a *client ID* , *client secret* , and *refresh token* , you can\ngenerate a new access token for use in API calls with the\n[`curl`](https://curl.haxx.se/) command line tool:\n**Note:** The version `v3` in the OAuth endpoint URL is unrelated to the Search Ads 360 Reporting API version and should not change when migrating to newer versions of Search Ads 360 Reporting API. \n\n curl \\\n --data \"grant_type=refresh_token\" \\\n --data \"client_id=\u003cvar translate=\"no\"\u003eCLIENT_ID\u003c/var\u003e\" \\\n --data \"client_secret=\u003cvar translate=\"no\"\u003eCLIENT_SECRET\u003c/var\u003e\" \\\n --data \"refresh_token=\u003cvar translate=\"no\"\u003eREFRESH_TOKEN\u003c/var\u003e\" \\\n https://www.googleapis.com/oauth2/v3/token\n\nYou then use the *access token* returned by the curl request in the\n`Authorization` HTTP header of every API call to the Search Ads 360 Reporting API: \n\n GET /v0/customers:listAccessibleCustomers HTTP/1.1\n Host: searchads360.googleapis.com\n Authorization: Bearer \u003cvar translate=\"no\"\u003eACCESS_TOKEN\u003c/var\u003e\n\nRequest headers\n---------------\n\n### Login customer ID\n\nFor Search Ads 360 Reporting API calls made by a manager to a client account (that is, when\nlogging in as a manager to make API calls to one of its client accounts), you\nalso need to supply the `login-customer-id` HTTP header. This value represents\nthe Search Ads 360 customer ID of the manager making the API call.\n\nIncluding this header is equivalent to choosing an account in the Search Ads 360 UI\nafter signing in or clicking on your profile image at the top-right corner of\nthe page. When specifying the customer ID, be sure to remove any hyphens (---),\nfor example: `1234567890`, not `123-456-7890`. \n\n GET /v0/customers:listAccessibleCustomers HTTP/1.1\n Host: searchads360.googleapis.com\n Authorization: Bearer \u003cvar translate=\"no\"\u003eACCESS_TOKEN\u003c/var\u003e\n login-customer-id: \u003cvar translate=\"no\"\u003eMANAGER_CUSTOMER_ID\u003c/var\u003e\n\nResponse headers\n----------------\n\nThe following headers are returned in HTTP responses from the API.\n\n### Request ID\n\nThe `request-id` is a string that uniquely identifies the API request. When\ndebugging or troubleshooting problems with specific API calls, the `request-id`\nis an important identifier to have handy when contacting Google developer\nsupport. \n\n request-id: 2a5Cj89VV7CNhya1DZjjrC"]]