HI

I always meet the ERROR [AuthorizationError.SERVICE_ACCESS_DENIED] when I 
tried to access adwords api.


<https://lh3.googleusercontent.com/-8AW-BTutL-A/Ws2FZj_9h2I/AAAAAAAAACw/137JsUesngUm-IIZOJ5UrdP4fZM6XZ8MwCLcBGAs/s1600/1.png>
Firstly, I can confim I am admin user on my MCC account.

Use this url to get auth_code:
*https://accounts.google.com/o/oauth2/v2/auth?response_type=code&access_type=offline&client_id=xxxxxxxxxxxxxxx&redirect_uri=urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob&state&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fadwords%20*

And this request to get refresh_token:
*curl -d code=4/AABpxxxxxxxxxxxxxxxxxx -d 
client_id=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx -d 
client_secret=xxxxxxxxxxxxxxxxxxxxxx -d 
redirect_uri=urn:ietf:wg:oauth:2.0:oob -d grant_type=authorization_code 
https://accounts.google.com/o/oauth2/token*

My part of code is like this with Node.js:

*let report = new AdwordsReport({*
*        developerToken: 'XXXXXXXXXXXX',*
*        userAgent: 'beta:reportDownload/1.0.1', *
*        clientCustomerId: 'XXX-XXX-XXXX', *
*        client_id: 'xxxxxxxxxxxxxxxxxxxxxxxx',*
*        client_secret: 'yyyyyyyyyyy',*
*        refresh_token: '1/xxxxxxxxxxxxxxxxxx'*
*    });*
*    report.getReport('v201802', {*
*        reportName: 'Custom Adgroup Performance Report',*
*        reportType: 'CAMPAIGN_PERFORMANCE_REPORT',*
*        fields: ['CampaignId', 'Impressions', 'Clicks', 'Cost'],*
*        filters: [*
*            { field: 'CampaignStatus', operator: 'IN', values: ['ENABLED', 
'PAUSED'] }*
*        ],*
*        dateRangeType: 'CUSTOM_DATE', //defaults to CUSTOM_DATE. startDate 
or endDate required for CUSTOM_DATE*
*        startDate: new Date("2018-04-05"),*
*        endDate: new Date(),*
*        format: 'CSV' //defaults to CSV*
*    }, (error, report) => {*
*        console.log('error:', error);*
*        console.log('report:', report);*
*    });*
*//Output is:*
*//error: <?xml version="1.0" encoding="UTF-8" 
standalone="yes"?><reportDownloadError><ApiError><type>AuthorizationError.SERVICE_ACCESS_DENIED</type><trigger></trigger><fieldPath></fieldPath></ApiError></reportDownloadError>*
*//report: null*


I have tried to read the related documents and the guide,but still get the 
error. Please tell me what can I do to sovle this problem.


<https://lh3.googleusercontent.com/-MhC4ABUYkCE/Ws2H-7Y65bI/AAAAAAAAADQ/9GLanJ0dKQ8V8LXEsPoQBWoEhk0QPebxgCLcBGAs/s1600/333.png>

<https://lh3.googleusercontent.com/-1lbvOcMQNhs/Ws2IUkCuo3I/AAAAAAAAADU/8w-ZYIy7ks45532RYATGnsWUtKRbjNHzQCLcBGAs/s1600/444.png>

<https://lh3.googleusercontent.com/-sA-AAmcZjmg/Ws2IlnokWKI/AAAAAAAAADc/s45MqOYRFREUrNOFpoVVXr4ud43bqumdwCLcBGAs/s1600/555.png>


-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
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 Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
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/e412e42e-042d-4ff8-a3bd-9d343dc1568f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
  • ... Kevin Tian
    • ... 'Milind Sankeshware (AdWords API Team)' via AdWords API Forum
    • ... 'Milind Sankeshware (AdWords API Team)' via AdWords API and Google Ads API Forum
    • ... 'Milind Sankeshware (AdWords API Team)' via AdWords API and Google Ads API Forum

Reply via email to