Hello Anirudh, Could you please confirm whether you are following the steps shown here <https://developers.google.com/google-ads/api/docs/oauth/internals#access_and_refresh_token> to generate refresh token? You could generate the access token from your refresh token using the below command (you can run it from terminal). Could you please elaborate what is the myKey in your line ' https://googleads.googleapis.com/v0/customers/myCustomerId?key=myKey';' <https://www.google.com/url?q=https://googleads.googleapis.com/v0/customers/myCustomerId?key%3DmyKey%27;%27&sa=D&source=hangouts&ust=1539367486121000&usg=AFQjCNFofz2z0F-xopY4BJEFuOXt710wbA> ?
curl --data ""grant_type=refresh_token"" --data ""refresh_token= *enter_your_refresh_token_here*"" --data ""client_id= *enter_your_client_Id_here*"" --data ""client_secret= *enter_your_client_secret_here*"" https://www.googleapis.com/oauth2/v4/token After the successful execution you will receive the access token valid till the next 60 minutes. Now try to run the below command to get the campaigns of your account. curl -H "Authorization: Bearer *YOUR_ACCESS_TOKEN*" -H "developer-token: *YOUR_DEVELOPER_TOKEN*" -H "Content-Type: application/json" https://googleads.googleapis.com/v0/customers/ *YOUR_CLIENT_CUSTOMER_ID*/googleAds:search --data '{query: "SELECT campaign.id, campaign.name FROM campaign ORDER BY campaign.id"}' If you are still facing issues please share the error log and elaborate the scenario you are trying. Regards, Sai Teja, AdWords API Team. On Thursday, October 11, 2018 at 7:14:33 AM UTC-4, anirudh maddy wrote: > > var url = ' > https://googleads.googleapis.com/v0/customers/myCustomerId?key=myKey'; > > var newAcessToken = > getGoogleAccessToken(refresh_token); > > var bearerToken = 'Bearer '+ newAcessToken; > > var options = { > url: url, > headers: { > 'Authorization': bearerToken, > 'Accept': '*/*', > 'developer-token': myDevToken > }, > }; > > > request(options, function(err, response) { > > if(err) > { > console.log(err); > > } > else > { > console.log(response.body); > res.end(); > } > > }); > -- -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ 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/1199846f-c212-456b-a52c-46dec855d0fa%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
