Issue with the developer token (Basic access)

91 views
Skip to first unread message

Abhinav Jain

unread,
Apr 3, 2024, 9:23:35 AM4/3/24
to Google Ads API and AdWords API Forum
Hi 
I have an approved google ads developer token, however, I still am unable to get the response. Can you please help. Attaching the account details and request and response (screenshot)

MCC Account ID :  "1660066223" 
Developer Token : "V1hmKeaaB8DyFmJG7IzQag" (Basic Access)
Reference ID : "1-1405000036389"

image.png

Thanks 
Abhinav 

Google Ads API Forum Advisor

unread,
Apr 3, 2024, 10:22:33 AM4/3/24
to abh...@regisedge.com, ads-api-compl...@google.com, adwor...@googlegroups.com
Hi,

Thank you for reaching out to the Google Ads API support team.

Upon checking your account '1660066223', I could see that you have the basic access level to the developer token. Kindly note that we are unable to view the request and response (screenshot). Could you please reshare as a .txt format and provide us with  more information on what exact support you want from the Google Ads API support team to assist you further.
 
This message is in relation to case "ref:!00D1U01174p.!5004Q02tOoth:ref" (ADR-00229721)

Thanks,
 
Google Logo Google Ads API Team


Abhinav Jain

unread,
Apr 4, 2024, 8:48:40 AM4/4/24
to Google Ads API and AdWords API Forum
Hi, 
Thanks for your response, please find the details attached. I am not sure, where I am going wrong here.
Regards 
Abhinav 

Request and Response Received

Request
-------
Method: /google.ads.googleads.v16.services.GoogleAdsService/SearchStream
Host: googleads.googleapis.com
Headers: {
  "developer-token": "REDACTED",
  "login-customer-id": "1660066223",
  "x-goog-api-client": "gl-python/3.11.8 grpc/1.62.1 gax/2.18.0 gccl/23.1.0 pb/4.25.3",
  "x-goog-request-params": "customer_id=5947094947"
}
Request: customer_id: "5947094947"
query: "\n            SELECT\n            campaign.id,\n            campaign.name,\n            campaign.status,\n            campaign.optimization_score,\n            campaign.bidding_strategy_type,\n            campaign.advertising_channel_type,\n            campaign.advertising_channel_sub_type,\n            segments.date, \n            segments.ad_network_type,\n            metrics.impressions,\n            metrics.clicks,\n            metrics.cost_micros,\n            metrics.ctr\n\n            FROM campaign\n            \n            WHERE segments.date BETWEEN \'2024-03-05\' AND \'2024-04-04\'\n            \n            ORDER BY segments.date"


Response
-------
Headers: {
  "google.ads.googleads.v16.errors.googleadsfailure-bin": "\n,\n\u0003\u0001\u0013\u0012%Oauth token HTTP header is malformed.\u0012\u0016nawblytU2o_PZPKko8-nYA",
  "grpc-status-details-bin": "\b\u0010\u0012\u0001Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.\u001a\u0001\nDtype.googleapis.com/google.ads.googleads.v16.errors.GoogleAdsFailure\u0012F\n,\n\u0003\u0001\u0013\u0012%Oauth token HTTP header is malformed.\u0012\u0016nawblytU2o_PZPKko8-nYA",
  "request-id": "nawblytU2o_PZPKko8-nYA"
}
Fault: errors {
  error_code {
    authentication_error: OAUTH_TOKEN_HEADER_INVALID
  }
  message: "Oauth token HTTP header is malformed."
}
request_id: "nawblytU2o_PZPKko8-nYA"



Abhinav Jain

unread,
Apr 4, 2024, 8:48:47 AM4/4/24
to Google Ads API and AdWords API Forum
Hi, 
Thanks for your help, please find the output attached below. 
Regards
Abhinav 



Request
-------
Method: /google.ads.googleads.v16.services.GoogleAdsService/SearchStream
Host: googleads.googleapis.com
Headers: {
  "developer-token": "REDACTED",
  "login-customer-id": "1660066223",
  "x-goog-api-client": "gl-python/3.11.8 grpc/1.62.1 gax/2.18.0 gccl/23.1.0 pb/4.25.3",
  "x-goog-request-params": "customer_id=5947094947"
}
Request: customer_id: "5947094947"
query: "\n            SELECT\n            campaign.id,\n            campaign.name,\n            campaign.status,\n            campaign.optimization_score,\n            campaign.bidding_strategy_type,\n            campaign.advertising_channel_type,\n            campaign.advertising_channel_sub_type,\n            segments.date, \n            segments.ad_network_type,\n            metrics.impressions,\n            metrics.clicks,\n            metrics.cost_micros,\n            metrics.ctr\n\n            FROM campaign\n            \n            WHERE segments.date BETWEEN \'2024-03-05\' AND \'2024-04-04\'\n            \n            ORDER BY segments.date"


Response
-------
Headers: {
  "google.ads.googleads.v16.errors.googleadsfailure-bin": "\n,\n\u0003\u0001\u0013\u0012%Oauth token HTTP header is malformed.\u0012\u0016F8EE4oVBOVTJRkyN0QdDIg",
  "grpc-status-details-bin": "\b\u0010\u0012\u0001Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.\u001a\u0001\nDtype.googleapis.com/google.ads.googleads.v16.errors.GoogleAdsFailure\u0012F\n,\n\u0003\u0001\u0013\u0012%Oauth token HTTP header is malformed.\u0012\u0016F8EE4oVBOVTJRkyN0QdDIg",
  "request-id": "F8EE4oVBOVTJRkyN0QdDIg"

}
Fault: errors {
  error_code {
    authentication_error: OAUTH_TOKEN_HEADER_INVALID
  }
  message: "Oauth token HTTP header is malformed."
}
request_id: "F8EE4oVBOVTJRkyN0QdDIg"


Request made: ClientCustomerId: 5947094947, Host: googleads.googleapis.com, Method: /google.ads.googleads.v16.services.GoogleAdsService/SearchStream, RequestId: F8EE4oVBOVTJRkyN0QdDIg, IsFault: True, FaultMessage: Oauth token HTTP header is malformed.


On Wednesday 3 April 2024 at 15:52:33 UTC+5:30 Google Ads API Forum Advisor wrote:

Google Ads API Forum Advisor

unread,
Apr 4, 2024, 4:02:01 PM4/4/24
to abh...@regisedge.com, adwor...@googlegroups.com
Hi Abhinav,

After checking the provided logs, it is observed that you have encountered the "OAUTH_TOKEN_HEADER_INVALID " error when trying to make a request to the searchStream.

It appears that the credentials sent in your HTTP request are not valid and this is why you have encountered this error. The prevention tip recommended is to make sure you've passed the correct access token associated with your account. It's sometimes confused with refresh tokens and authorization codes. If you would like to get a credential that can access all client accounts under a manager account, make sure you get the refresh token for the manager account. For more details, see our guide on access token and refresh token and OAuth2

Reply all
Reply to author
Forward
0 new messages