Hi,
I have been trying to figure this out now for about 3 weeks. Who would have thought that a REST API can be complicated. So I have tried many things to get this to work. In fact I can't even remember half the things I've tried.
But here goes.
I have a product manager account under which I have created a dev token. It is currently under level: Test account.
I then go the the OAuth 2.0 Playground
- I then select a manager account. The one used to create the dev token and allow access using this account
Step 2 - Exchange authorization code for token
Step 4 - In the headers I add developer-token and add the dev token. I also add login-customer-id = to the product managers Client ID
It then returns. (I can even replace the Test client ID with the manager ID. It makes no differance)
HTTP/1.1 403 Forbidden
Content-length: 732
X-xss-protection: 0
X-content-type-options: nosniff
Transfer-encoding: chunked
Request-id: -eaa2Fc5qZjn0EGFVEJkaA
Vary: Origin, X-Origin, Referer
Server: ESF
-content-encoding: gzip
Cache-control: private
Date: Thu, 23 Sep 2021 08:28:33 GMT
X-frame-options: SAMEORIGIN
Alt-svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000,h3-T051=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"
Content-type: application/json; charset=UTF-8{
"error": {
"status": "PERMISSION_DENIED",
"message": "The caller does not have permission",
"code": 403,
"details": [
{
"errors": [
{
"errorCode": {
"authorizationError": "USER_PERMISSION_DENIED"
},
"message": "User doesn't have permission to access customer. Note: If you're accessing a client customer, the manager's customer id must be set in the 'login-customer-id' header. See
https://developers.google.com/google-ads/api/docs/concepts/call-structure#cid"
}
],
"@type": "
type.googleapis.com/google.ads.googleads.v8.errors.GoogleAdsFailure",
"requestId": "-eaa2Fc5qZjn0EGFVEJkaA"
}
]
}
}
If I replace the Test client ID with a production Client ID. I get
HTTP/1.1 403 Forbidden
Content-length: 593
X-xss-protection: 0
X-content-type-options: nosniff
Transfer-encoding: chunked
Request-id: vFtxYPFFlbkPLYz9dD4cBQ
Vary: Origin, X-Origin, Referer
Server: ESF
-content-encoding: gzip
Cache-control: private
Date: Thu, 23 Sep 2021 08:32:20 GMT
X-frame-options: SAMEORIGIN
Alt-svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000,h3-T051=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"
Content-type: application/json; charset=UTF-8{
"error": {
"status": "PERMISSION_DENIED",
"message": "The caller does not have permission",
"code": 403,
"details": [
{
"errors": [
{
"errorCode": {
"authorizationError": "DEVELOPER_TOKEN_NOT_APPROVED"
},
"message": "The developer token is not approved. Non-approved developer tokens can only be used with test accounts."
}
],
"@type": "
type.googleapis.com/google.ads.googleads.v8.errors.GoogleAdsFailure",
"requestId": "vFtxYPFFlbkPLYz9dD4cBQ"
}
]
}
}
Which is expected.
What would be the url end point for getallcustomer? I want to send a request to see which customer ID's are linked to the test account. I'n this way I could try work out which text accounts I can access.
Any assistance with this would be greatly appreciated.
Just on a side note. Why does the OAuth 2.0 Playground not return any info if the "List possible operations" button is pressed