Hi Gonzalo, Also, why are you copying the code from the client library instead of using it directly?
Cheers, Anash P. Oommen, AdWords API Advisor. On Wednesday, May 28, 2014 11:10:54 AM UTC-4, Gonzalo Garcia wrote: > > Estimados, > > Estoy usando el proyecto de ejemplo que me descargue del sitio. > > > *********************************************************************************************************** > > Namespace: Google.Api.Ads.Common.Lib > > Class: OAuth2ProviderForApplications > > Method: FetchAccessAndRefreshTokens > > > ***************************************************************************** > > Detalle del métdo: > > > > public bool FetchAccessAndRefreshTokens(string authorizationCode) { > > string redirectUrl = (string.IsNullOrEmpty(RedirectUri)) ? > OFFLINE_REDIRECT_URL : RedirectUri; > > > > if (string.IsNullOrEmpty(authorizationCode)) { > > throw new ArgumentNullException(CommonErrorMessages > .OAuth2AuthorizationCodeIsEmpty); > > } > > ValidateOAuth2Parameter("ClientId", ClientId); > > ValidateOAuth2Parameter("ClientSecret", ClientSecret); > > string body = string.Format( > "code={0}&client_id={1}&client_secret={2}&redirect_uri={3}" + > > "&grant_type={4}", HttpUtility.UrlEncode(authorizationCode), > > HttpUtility.UrlEncode(ClientId), HttpUtility > .UrlEncode(ClientSecret), > > HttpUtility.UrlEncode(redirectUrl), HttpUtility > .UrlEncode(authorizationCode)); > > try { > > CallTokenEndpoint(body); > > } catch (ApplicationException e) { > > throw new AdsOAuthException("Failed to get access token." + "\n" > + e.Message); > > } > > return true; > > } > > > Luego de obtener el código de autorización necesito obtener el “TOKEN”, > pero estoy recibiendo el siguiente error: > > > > > > > > *Failed to get access token. { "error" : "invalid_request", > "error_description" : "Invalid grant_type: > 4/47ToZtgnu1fjb00oiz7kRqKU6Bor.MlHJmYy0NAgW3oEBd8DOtNADn98rjAI" }* > > ¿Que puede ser? > > > Gracias y saludos, > > Gonzalo > -- -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ 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. For more options, visit https://groups.google.com/d/optout.