I just ran into this error as well. I tried to go to the URL you provided, Josh, and got the following error:
{ "error": "invalid_token", "error_description": "Invalid Value" } Which is weird since I *just* used that token to generate a refresh token. Here's my code (essentially): $oauth2Info = array( 'client_id' => CLIENT_ID, 'client_secret' => CLIENT_SECRET, 'access_token' => $_GET['code'], ); $user = new AdWordsUser(NULL, DEVELOPER_TOKEN, NULL, USER_AGENT, NULL, NULL, $oauth2Info); $customerService = $user->GetService("CustomerService"); $customer = $customerService->get(); // this line errors printf("You are logged in as customer: %s\n", $customer->customerId); $user->LogAll(); $user->setCustomerId($customer->customerId); $report = ReportUtils::DownloadReportWithAwql(" SELECT * FROM KEYWORDS_PERFORMANCE_REPORT DURING LAST_7_DAYS ", CSV_PATH, $user, 'CSV'); I'm currently using my MCC account to test the OAuth2 flow, since that's the only account I have access to. Could that be the problem by any chance? On Thursday, January 8, 2015 at 7:18:45 AM UTC-8, Josh Radcliff (AdWords API Team) wrote: > > Hi, > > Could you provide some more details? For example, are you using one of the > client libraries, or just constructing the OAuth and API requests manually? > You mentioned that it works after your second attempt -- are you referring > to your second attempt to get an access token using a refresh token, or > something else? > > If you have sample requests and responses (with any sensitive information > removed), please post those as well to help us diagnose the problem. > > Thanks, > Josh, AdWords API Team > > On Wednesday, January 7, 2015 10:26:50 PM UTC-5, Van Sereyboth wrote: >> >> Hi I keep getting the above error while writing rspec in RoR. >> >> The first attempt to request is always causing me this mentioned error. >> the second attempt is working so fine without any glitches. >> >> here is how I get after testing my access_token: >> >> { >> >> - scope: "https://adwords.google.com/api/adwords/", >> - expires_in: 1827, >> - access_type: "offline" >> >> } >> >> On Thursday, April 17, 2014 9:48:00 PM UTC+7, Josh Radcliff (AdWords API >> Team) wrote: >>> >>> Hi, >>> >>> The error code AuthenticationError.OAUTH_TOKEN_INVALID indicates that >>> there's an issue with the access token in the *Authorization* header. >>> It usually means the token has expired, which you can confirm via the URL >>> below after appending your *access* (not refresh) token to the end. >>> >>> https://www.googleapis.com/oauth2/v1/tokeninfo?access_token= >>> <https://www.googleapis.com/oauth2/v1/tokeninfo?access_token=YOUR_ACCESS_TOKEN> >>> >>> When you generated the refresh token did you use the >>> GetRefreshToken.java >>> <https://github.com/googleads/googleads-java-lib/blob/master/examples/adwords_axis/src/main/java/adwords/axis/auth/GetRefreshToken.java> >>> example >>> and follow the instructions on our wiki >>> <https://github.com/googleads/googleads-java-lib/wiki/Using-OAuth2.0#using-offline-credentials-offlinecredentials> >>> ? >>> >>> Thanks, >>> Josh, AdWords API Team >>> >>> >>> On Wednesday, April 16, 2014 7:45:15 AM UTC-4, Sandeep Gupta wrote: >>>> >>>> HI This is Sandeep here, i am trying to integrate Google Adword API to >>>> utilize it better way, but i am getting below error. >>>> faultString: [AuthenticationError.OAUTH_TOKEN_INVALID @ ; >>>> trigger:'<null>'] >>>> >>>> >>>> i have generated CLient ID, Client secret and Refresh token and added >>>> these values in ads.properties. >>>> >>>> But i am getting error on below steps. >>>> >>>> Selector selector = builder >>>> .fields("Id", "Name") >>>> .orderAscBy("Name") >>>> .offset(offset) >>>> .limit(PAGE_SIZE) >>>> .build(); >>>> CampaignPage page = campaignService.get(selector); // this step is >>>> giving error. >>>> >>>> >>>> ERROR DETAILS :: >>>> >>>> pr 16, 2014 5:01:15 PM org.apache.axis.utils.JavaUtils >>>> isAttachmentSupported >>>> WARNING: Unable to find required classes (javax.activation.DataHandler >>>> and javax.mail.internet.MimeMultipart). Attachment support is disabled. >>>> Exception in thread "main" AxisFault >>>> faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server >>>> faultSubcode: >>>> faultString: [AuthenticationError.OAUTH_TOKEN_INVALID @ ; >>>> trigger:'<null>'] >>>> faultActor: >>>> faultNode: >>>> faultDetail: >>>> {https://adwords.google.com/api/adwords/cm/v201402}ApiExceptionFault:<message>[AuthenticationError.OAUTH_TOKEN_INVALID >>>> >>>> @ ; >>>> trigger:'<null>']</message><ApplicationException.Type>ApiException</ApplicationException.Type><errors >>>> >>>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >>>> xsi:type="AuthenticationError"><fieldPath/><trigger><null></trigger><errorString>AuthenticationError.OAUTH_TOKEN_INVALID</errorString><ApiError.Type>AuthenticationError</ApiError.Type><reason>OAUTH_TOKEN_INVALID</reason></errors> >>>> >>>> [AuthenticationError.OAUTH_TOKEN_INVALID @ ; trigger:'<null>'] >>>> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) >>>> at >>>> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) >>>> at >>>> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) >>>> at java.lang.reflect.Constructor.newInstance(Constructor.java:513) >>>> at java.lang.Class.newInstance0(Class.java:355) >>>> at java.lang.Class.newInstance(Class.java:308) >>>> at >>>> org.apache.axis.encoding.ser.BeanDeserializer.<init>(BeanDeserializer.java:104) >>>> at >>>> org.apache.axis.encoding.ser.BeanDeserializer.<init>(BeanDeserializer.java:90) >>>> at >>>> com.google.api.ads.adwords.axis.v201402.cm.ApiException.getDeserializer(ApiException.java:143) >>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >>>> at >>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) >>>> at >>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) >>>> at java.lang.reflect.Method.invoke(Method.java:597) >>>> at >>>> org.apache.axis.encoding.ser.BaseDeserializerFactory.getSpecialized(BaseDeserializerFactory.java:154) >>>> at >>>> org.apache.axis.encoding.ser.BaseDeserializerFactory.getDeserializerAs(BaseDeserializerFactory.java:84) >>>> at >>>> org.apache.axis.encoding.DeserializationContext.getDeserializer(DeserializationContext.java:464) >>>> at >>>> org.apache.axis.encoding.DeserializationContext.getDeserializerForType(DeserializationContext.java:547) >>>> at >>>> org.apache.axis.message.SOAPFaultDetailsBuilder.onStartChild(SOAPFaultDetailsBuilder.java:157) >>>> at >>>> org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1035) >>>> at >>>> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:501) >>>> at >>>> com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:400) >>>> at >>>> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2755) >>>> at >>>> com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648) >>>> at >>>> com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140) >>>> at >>>> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:511) >>>> at >>>> com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:808) >>>> at >>>> com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737) >>>> at >>>> com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119) >>>> at >>>> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205) >>>> at >>>> com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522) >>>> at javax.xml.parsers.SAXParser.parse(SAXParser.java:395) >>>> at >>>> org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227) >>>> at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696) >>>> at org.apache.axis.Message.getSOAPEnvelope(Message.java:435) >>>> at >>>> org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62) >>>> at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206) >>>> at org.apache.axis.client.Call.invokeEngine(Call.java:2784) >>>> at org.apache.axis.client.Call.invoke(Call.java:2767) >>>> at org.apache.axis.client.Call.invoke(Call.java:2443) >>>> at org.apache.axis.client.Call.invoke(Call.java:2366) >>>> at org.apache.axis.client.Call.invoke(Call.java:1812) >>>> at >>>> com.google.api.ads.adwords.axis.v201402.cm.BudgetServiceSoapBindingStub.mutate(BudgetServiceSoapBindingStub.java:795) >>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >>>> at >>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) >>>> at >>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) >>>> at java.lang.reflect.Method.invoke(Method.java:597) >>>> at >>>> com.google.api.ads.common.lib.soap.SoapClientHandler.invoke(SoapClientHandler.java:109) >>>> at >>>> com.google.api.ads.common.lib.soap.axis.AxisHandler.invokeSoapCall(AxisHandler.java:201) >>>> at >>>> com.google.api.ads.common.lib.soap.SoapServiceClient.callSoapClient(SoapServiceClient.java:64) >>>> at >>>> com.google.api.ads.common.lib.soap.SoapServiceClient.invoke(SoapServiceClient.java:93) >>>> at $Proxy15.mutate(Unknown Source) >>>> at >>>> com.homeshop18.adword.basic.GetCampaigns.runExample(GetCampaigns.java:107) >>>> at com.homeshop18.adword.basic.GetCampaigns.main(GetCampaigns.java:71) >>>> >>>> >>>> -- -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ 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 http://groups.google.com/group/adwords-api. To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-api/173f86c9-77b9-4488-b842-c95ad1cb47af%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.