API requests not working after token approval/reauthorization

45 views
Skip to first unread message

Farid el Nasire

unread,
Oct 25, 2016, 12:58:13 PM10/25/16
to AdWords API Forum
We have been working on an application which uses the AdWords API to create/manage campaigns. While we were waiting for our token to be approved we used a test token, which allowed us to create campaigns/ad groups/ads and whatnot in a safe sandboxed demo environment. This has been working fine.
Today we reauthorized our app to access our AdWords account using our approved token, but we are suddenly running into errors. After closer inspection I found out that the Adwords API is suddenly returning AuthorizationError.USER_PERMISSION_DENIED.
Any idea what we are doing wrong? I have already tried regenerating the token and then reauthorizing again, there are no errors during authorization.

Farid el Nasire

unread,
Oct 25, 2016, 1:50:32 PM10/25/16
to AdWords API Forum
Got 1 step further by updating the customer id. I can now get a list of campaigns (which right now returns nothing) but now I am getting the following error:
OperationAccessDenied.ADD_OPERATION_NOT_PERMITTED @ class campaignmgmt.campaign.MutateAction (ADD) requires CREATE_CAMPAIGN

Vishal Vinayak (Adwords API Team)

unread,
Oct 25, 2016, 3:04:18 PM10/25/16
to AdWords API Forum
Hi Farid, 

You may see OperationAccessDenied.ADD_OPERATION_NOT_PERMITTED error if you try to add campaigns to your manager account (instead of your client account). I would recommend a few things when switching from a test account to a production account in your client library:
  1. Ensure your test account credentials (client ID, client secret & refresh token) are replaced with the production account credentials in your properties file. Developer token remains the same.
  2. Check if the client customer ID (in your properties file) points to the 10 digit account ID of your production AdWords account (and not your manager account).  
If you still see issues, could you please provide me with the SOAP XML request and response logs for the API call? You can get more information on how to enable logging by going to the github repository of your client library and checking the logging section in the readme file. For example, you can find information regarding enabling SOAP logs for a java application under the section "How do I enable logging?" of the Java AdWords API Github Repository. Also, in case you just enabled SOAP logging, you would need to make the same API call again to retrieve SOAP logs. Please click on Reply privately to author when responding. 

Regards,
Vishal, AdWords API Team
Reply all
Reply to author
Forward
0 new messages