Regarding authentication error

47 views
Skip to first unread message

ServiceNow Test Account

unread,
Mar 19, 2019, 6:16:35 AM3/19/19
to adwor...@googlegroups.com, sange...@position2.com
Hi,

Tried making the API call with the below request, but got an authorization error. I am using the developer token of the manager account. Please refer the screenshot of the API center console attached. Why am I getting this error ? How to fix this ?

Below is the request and response xml.

Request: 


<s:Envelope
<s:Header>
<RequestHeader
<clientCustomerId
</clientCustomerId>
<developerToken
</developerToken>
<userAgent
xmlns="https://adwords.google.com/api/adwords/cm/v201809">unknown (AwApi-DotNet/24.1.0, Common-Dotnet/9.4.0, .NET CLR/4.0.30319.42000, OAuthServiceAccountFlow, SelectorBuilder, gzip)
</userAgent>
</RequestHeader>
</s:Header>
<s:Body
<get
<selector>
<searchParameters xsi:type="RelatedToQuerySearchParameter">
<queries>bakery</queries>
<queries>pastries</queries>
<queries>birthday cake</queries>
</searchParameters>
<searchParameters xsi:type="LanguageSearchParameter">
<languages>
<id
</id>
</languages>
</searchParameters>
<searchParameters xsi:type="NetworkSearchParameter">
<networkSetting>
<targetGoogleSearch
</targetGoogleSearch>
<targetSearchNetwork
</targetSearchNetwork>
<targetContentNetwork
</targetContentNetwork>
<targetPartnerSearchNetwork
</targetPartnerSearchNetwork>
</networkSetting>
</searchParameters>
<ideaType>KEYWORD</ideaType>
<requestType>IDEAS</requestType>
<requestedAttributeTypes>KEYWORD_TEXT</requestedAttributeTypes>
<requestedAttributeTypes>SEARCH_VOLUME</requestedAttributeTypes>
<requestedAttributeTypes>AVERAGE_CPC</requestedAttributeTypes>
<requestedAttributeTypes>COMPETITION</requestedAttributeTypes>
<requestedAttributeTypes>CATEGORY_PRODUCTS_AND_SERVICES</requestedAttributeTypes>
<paging>
<startIndex
</startIndex>
<numberResults
</numberResults>
</paging>
</selector>
</get>
</s:Body>
</s:Envelope>




Response:

<soap:Envelope 
    <soap:Header>
        <ResponseHeader 
            <ns2:requestId>000584617ed5e83c0ab46599d9071107</ns2:requestId>
            <ns2:serviceName>TargetingIdeaService</ns2:serviceName>
            <ns2:methodName>get</ns2:methodName>
            <ns2:operations>1</ns2:operations>
            <ns2:responseTime>59</ns2:responseTime>
        </ResponseHeader>
    </soap:Header>
    <soap:Body>
        <soap:Fault>
            <faultcode>soap:Server</faultcode>
            <faultstring>[AuthorizationError.USER_PERMISSION_DENIED @ ; trigger:'&lt;null&gt;']</faultstring>
            <detail>
                <ApiExceptionFault 
                    xmlns="https://adwords.google.com/api/adwords/o/v201809
                    xmlns:ns2="https://adwords.google.com/api/adwords/cm/v201809">
                    <ns2:message>[AuthorizationError.USER_PERMISSION_DENIED @ ; trigger:'&lt;null&gt;']</ns2:message>
                    <ns2:ApplicationException.Type>ApiException</ns2:ApplicationException.Type>
                    <ns2:errors 
                        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns2:AuthorizationError">
                        <ns2:fieldPath></ns2:fieldPath>
                        <ns2:trigger>&lt;null&gt;</ns2:trigger>
                        <ns2:errorString>AuthorizationError.USER_PERMISSION_DENIED</ns2:errorString>
                        <ns2:ApiError.Type>AuthorizationError</ns2:ApiError.Type>
                        <ns2:reason>USER_PERMISSION_DENIED</ns2:reason>
                    </ns2:errors>
                </ApiExceptionFault>
            </detail>
        </soap:Fault>
    </soap:Body>
</soap:Envelope>
Screen Shot 2019-03-19 at 10.47.25 AM.png

ServiceNow Test Account

unread,
Mar 19, 2019, 9:18:46 AM3/19/19
to adwor...@googlegroups.com, sange...@position2.com, deepu...@position2.com, aje...@position2.com, sudh...@position2.com
Adding Ajesh / Sudheer 

On Tue, Mar 19, 2019 at 10:49 AM ServiceNow Test Account <servic...@position2.com> wrote:
Hi,

Tried making the API call with the below request, but got an authorization error. I am using the developer token of the manager account. Please refer the screenshot of the API center console attached. Why am I getting this error ? How to fix this ?

Below is the request and response xml.

Request: 


<s:Envelope
<s:Header>
<RequestHeader
<clientCustomerId
</clientCustomerId>
<developerToken

googleadsapi...@google.com

unread,
Mar 19, 2019, 1:09:08 PM3/19/19
to adwor...@googlegroups.com
Hello, 

Thank you for the logs. Please avoid posting confidential information on the group, particularly developer tokens. When attaching logs, make sure to remove this data going forward. I have editted these details in the public forum. You can still provide object IDs such as campaign ID, ad group ID etc. to help us investigate the issue. If you suspect that your developer token is compromised, please follow the steps shown in this guide to reset the developer token. The USER_PERMISSION_DENIED error occurs when the account is not linked to an MCC that can directly manage accounts. Another possible reason is that the OAuth2 credentials used has no access to the specific client account.

Is there any specific reason you're using service accounts? We strongly recommend using installed app or web flows instead of service accounts unless you need domain-specific features (for example, impersonation). OAuth2 installed application and web flows require user interaction only once, when access to the account is granted. Could you please share the email address used for authentication along with the client account CID from which the API calls are made, so I can check this further? You can reply back via Reply privately to author option. Please note that I removed the emails and you can follow the conversation on the forum thread. If you would like me to convert this to a private thread please confirm.

Regards,
Bharani, AdWords API Team

=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
    http://googleadsdeveloper.blogspot.com/search/label/adwords_api
    https://developers.google.com/adwords/api/community/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

Was your question answered? Please rate your experience with us by taking a short survey.
If not -- reply to this email and tell us what else we can do to help.

Take Survey

Also find us on our blog and discussion group:
http://googleadsdeveloper.blogspot.com/search/label/adwords_api
https://developers.google.com/adwords/api/community/

servic...@position2.com

unread,
Mar 21, 2019, 5:17:07 AM3/21/19
to AdWords API and Google Ads API Forum
Hi,

Details of AdWords account: 

CID: 540-621-8576 

If it is possible shall we have a screen sharing session to figure out the issue

googleadsapi...@google.com

unread,
Mar 21, 2019, 10:07:15 AM3/21/19
to AdWords API and Google Ads API Forum
Hello, 

We will be able to offer support only through emails. It looks like you're using a Manager account to make the API call. The error is triggered if your OAuth credentials are for a user who does not have access to the client customer ID specified or any of its manager accounts. Could you please confirm if you're generating the OAuth credentials for the manager account or the client account? If for the manager account, can you make sure that you're generating the OAuth credentials by authorizing as a user who has access to this account? You could use CustomerService.getCustomers() which returns details of all the customers directly accessible by the user authenticating the call and then use the ManagedCustomerService to determine the client accounts linked to a manager account.

Could you please give this a try and let me know the results? You can share the details privately via Reply privately to author option.

Thanks,
Bharani, Google Ads API Team
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
    http://googleadsdeveloper.blogspot.com/search/label/adwords_api
    https://developers.google.com/adwords/api/community/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

ServiceNow Test Account

unread,
Mar 21, 2019, 10:31:14 PM3/21/19
to googleadsapi...@google.com, AdWords API and Google Ads API Forum
Thanks. This issue has been resolved

Regards
Deepu

--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 adwor...@googlegroups.com
To unsubscribe from this group, send email to
adwords-api...@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 and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to adwords-api...@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/186u5500000000008uak0q000sfnkky68mjgc9h68o30c1g68r30c9p%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages