Hello Aniruth,

If you are looking to get the accounts under your manager account you have
to use the resource customer_client
<https://developers.google.com/google-ads/api/docs/fields/customer_client>
instead. The error message you are seeing will occur when the developer
token is not passed to the API call properly. Since our client libraries
will support the languages mentioned here
<https://developers.google.com/google-ads/api/docs/client-libs> only, I
don't have any Node Js examples. But I can give you the sample CURL
operation that you can perform from your terminal and build you Node Js
code by referring them.

Sample CURL code to get accounts linked to your manager account:

curl -H "Authorization: Bearer *Access_token*"
       -H "developer-token: *DeveloperToken*"
       -H "Content-Type: application/json"
https://googleads.googleapis.com/v1/customers/*MCC_ID*/googleAds:search
       --data '{query: "SELECT customer_client.resource_name,
customer_client.client_customer, customer_client.level,
customer_client.hidden FROM customer_client"}'

Sample CURL operation to get the accessible customers from the OAuth
credentials:

curl -H "Authorization: Bearer *Access_Token*"
       -H "developer-token: *Developer_Token*"
       -H "Content-Type: application/json"
https://googleads.googleapis.com/v1/customers:listAccessibleCustomers

Could you please give it a try and let me know if you have any further
questions.

Regards,
Sai Teja, Google Ads API Team

=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
    https://ads-developers.googleblog.com/search/label/google_ads_api
    https://developers.google.com/adwords/api/community/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

On 05/07/19 04:21:56 [email protected] wrote:

I'm passing the Developer Token in the GET request to fetch the MCC
accounts. But I keep getting the below error even though I'm passing the
required information.




"message": "developer-token parameter is missing



I tried making the request in different ways. But I'm unable to figure it
out. Code is in Node JS

V1: GET request

var options = {
url: 'https://googleads.googleapis.com/v1/customers:listAccessibleCustomers',

               auth: {
                'bearer': access_token,
                    'developer-token':'XXXX_XXXXXXXXXX'
                 }

            };

        console.log('Access Token is - ', access_token);

        request(options, function(err, response) {
                console.log(response);
            });



v2: GET request

var bearerToken = 'Bearer '+ access_token;

 var options = {
url: 'https://googleads.googleapis.com/v1/customers:listAccessibleCustomers',

           headers: {
              'Authorization': bearerToken,
              'developer-token': 'XXXX_XXXXXXXXXX'
                }

        };



    request(options, function(err, response) {
                console.log(response);
         });


--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
---
You received this message because you are subscribed to the Google Groups
"AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to [email protected].
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit
https://groups.google.com/d/msgid/adwords-api/dd3f1a29-c719-4f81-811c-12239882b10f%40googlegroups.com
<https://groups.google.com/d/msgid/adwords-api/dd3f1a29-c719-4f81-811c-12239882b10f%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.

--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- You received this message because you are subscribed to the Google Groups "AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/ijlio2kb7o0000010o842q000clbrky6kmjcc1k60o30c1g68r30dpg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
  • develop... anirudh . maddy
    • RE... googleadsapi-forumadvisor via AdWords API and Google Ads API Forum
    • Re... anirudh maddy
    • Re... anirudh maddy
      • ... googleadsapi-forumadvisor via AdWords API and Google Ads API Forum
        • ... anirudh maddy
    • Re... anirudh maddy
      • ... googleadsapi-forumadvisor via AdWords API and Google Ads API Forum

Reply via email to