Re: Adwords API Auth2
Hi , I downloaded the google adwords dotnet library with examples I ran the Oauth Project (…….examples\AdWords\csharp\oauth) THis project has two aspx pages I just added some code in the below function as follows private void DoAuth2Configuration(AdWordsAppConfig config) { config.Email = te...@gmail.com; config.Password = xxx!; config.UserAgent = ; config.DeveloperToken = x; config.AuthorizationMethod = AdWordsAuthorizationMethod .OAuth2; config.ClientCustomerId = 123-456-789.ToString().Replace( -, ); config.OAuth2ClientId = .apps.googleusercontent.com; config.OAuth2ClientSecret = _x; config.OAuth2RedirectUri = Request.Url.GetLeftPart( UriPartial.Path); // Create an OAuth2 object for handling OAuth2 flow. OAuth2ProviderForApplications oAuth = new OAuth2ProviderForApplications(config); if (Request.Params[state] == null) { // This is the first time this page is being loaded. // Set the state variable to any value that helps you recognize // when this url will be called by the OAuth2 server. oAuth.State = callback; // Create an authorization url and redirect the user to that page. Response.Redirect(oAuth.GetAuthorizationUrl()); } else if (Request.Params[state] == callback) { oAuth.FetchAccessAndRefreshTokens(Request.Params[code]); Session[OAuthProvider] = oAuth; // Redirect the user to the main page. Response.Redirect(Default.aspx); } else { throw new Exception(Unknown state for OAuth callback.); } } And then ran the application I was redirect to my google account below screen https://lh5.googleusercontent.com/-d8XtCBZPhSk/U8fiBHcFMNI/AIQ/QYzEdMyoVoA/s1600/login.png step 1 :After Entering Credentials I was redirected to the below screen https://lh6.googleusercontent.com/-vefVy9qtwYM/U8fiPItm1eI/AIY/fXsPNJMJb7U/s1600/accept.jpg Step 2 : After clicking Accept I was redirected to the default.aspx https://lh3.googleusercontent.com/-4HQCp0tbviE/U8fic3a42II/AIg/g7yBQtbjR0c/s1600/campaign.png *After Entering the Customer ID I was able to get the Campaign Details* *In this I came across that I need to login into my google adwords Account , Click Accept* *In which the Application redirects an authoriztion URL When I click accept I receive an authorization code* *Which I use to Fetch Access And Refresh Tokens Which is then used by the google api (camapign Service )* *to get the campaign Details* *Is there any way in which I can avoid the steps 1 and 2 so that I don’t need to Login and click Accept* *Is there any way I can get the authorization code directly and use it to Fetch Access And Refresh Tokens* *As I have a web application in which my clients use the api to get campaign details and statistics of campaign* *I don’t want then to go through these steps* *Please Suggest * *Thanks and Regards* On Monday, July 21, 2014 4:35:12 PM UTC+5:30, Altaf Mulla wrote: *Auth2 Authentication* *Is there any way in which I can avoid the process the Login and click Accept * *Can i not use the google adwords api by setting my credentails ,developer token ,etc* *Is there any way I can get the authorization code directly and use it to Fetch Access And Refresh Tokens* *As I have a web application in which my clients use the api to get campaign details and statistics of campaign* *I don’t want then to go through Login precodure and click of accept button for Auth2 authentication* *Please Suggest * *Thanks and Regards* *Altaf* -- -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ 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.
Adwords api integration Query
https://lh3.googleusercontent.com/-4HQCp0tbviE/U8fic3a42II/AIg/g7yBQtbjR0c/s1600/campaign.png https://lh6.googleusercontent.com/-vefVy9qtwYM/U8fiPItm1eI/AIY/fXsPNJMJb7U/s1600/accept.jpg https://lh5.googleusercontent.com/-d8XtCBZPhSk/U8fiBHcFMNI/AIQ/QYzEdMyoVoA/s1600/login.png Hi , I downloaded the google adwords dotnet library with examples I ran the Oauth Project (…….examples\AdWords\csharp\oauth) THis project has two aspx pages I just added some code in the below function as follows private void DoAuth2Configuration(AdWordsAppConfig config) { config.Email = t...@gmail.com; config.Password = xxx!; config.UserAgent = ; config.DeveloperToken = x; config.AuthorizationMethod = AdWordsAuthorizationMethod .OAuth2; config.ClientCustomerId = 123-456-789.ToString().Replace( -, ); config.OAuth2ClientId = .apps.googleusercontent.com; config.OAuth2ClientSecret = _x; config.OAuth2RedirectUri = Request.Url.GetLeftPart( UriPartial.Path); // Create an OAuth2 object for handling OAuth2 flow. OAuth2ProviderForApplications oAuth = new OAuth2ProviderForApplications(config); if (Request.Params[state] == null) { // This is the first time this page is being loaded. // Set the state variable to any value that helps you recognize // when this url will be called by the OAuth2 server. oAuth.State = callback; // Create an authorization url and redirect the user to that page. Response.Redirect(oAuth.GetAuthorizationUrl()); } else if (Request.Params[state] == callback) { oAuth.FetchAccessAndRefreshTokens(Request.Params[code]); Session[OAuthProvider] = oAuth; // Redirect the user to the main page. Response.Redirect(Default.aspx); } else { throw new Exception(Unknown state for OAuth callback.); } } And then ran the application I was redirect to my google account below screen https://lh5.googleusercontent.com/-d8XtCBZPhSk/U8fiBHcFMNI/AIQ/QYzEdMyoVoA/s1600/login.png step 1 :After Entering Credentials I was redirected to the below screen https://lh6.googleusercontent.com/-vefVy9qtwYM/U8fiPItm1eI/AIY/fXsPNJMJb7U/s1600/accept.jpg Step 2 : After clicking Accept I was redirected to the default.aspx https://lh3.googleusercontent.com/-4HQCp0tbviE/U8fic3a42II/AIg/g7yBQtbjR0c/s1600/campaign.png *After Entering the Customer ID I was able to get the Campaign Details* *In this I came across that I need to login into my google adwords Account , Click Accept * *In which the Application redirects an authoriztion URL When I click accept I receive an authorization code * *Which I use to Fetch Access And Refresh Tokens Which is then used by the google api (camapign Service )* *to get the campaign Details* *Is there any way in which I can avoid the steps 1 and 2 so that I don’t need to Login and click Accept* *Is there any way I can get the authorization code directly and use it to Fetch Access And Refresh Tokens* *As I have a web application in which my clients use the api to get campaign details and statistics of campaign * *I don’t want then to go through these steps * *Please Suggest * *Thanks and Regards * *Altaf* -- -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ 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.
Re: Google AdWordsService v201306
Hi, I have migrated From Client Login to Access token i am using the below code after migration i have modified my earlier code after getting OAuth2ClientId ,OAuth2ClientSecret ,OAuth2RefreshToken as below Dim config As AdWordsAppConfig = DirectCast(user.Config, AdWordsAppConfig) config.Email = salesfusion...@gmail.com config.Password = xxx! config.UserAgent = x config.DeveloperToken = xx config.AuthorizationMethod = AdWordsAuthorizationMethod.OAuth2 config.ClientCustomerId = 123-456-7890.ToString.Replace(-, ) config.OAuth2ClientId = xxx-i4x.apps.googleusercontent.com config.OAuth2ClientSecret = xx config.OAuth2RefreshToken = xxx but now i get this error * Failed to refresh access token.* * {* * error : invalid_grant* *}* *please let me know if i am missing something* On Friday, July 11, 2014 3:40:08 PM UTC+5:30, Altaf Mulla wrote: Hi I am using Google AdWordsService.v201306 in this i am using the campaign Service AdWordsService.v201306.CampaignService page = CampaignServiceObj.get(selector) i am getting error for this line Please let me know what is the issue -- -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ 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.
Google AdWordsService v201306
Hi I am using Google AdWordsService.v201306 in this i am using the campaign Service AdWordsService.v201306.CampaignService page = CampaignServiceObj.get(selector) i am getting error for this line Please let me know what is the issue -- -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ 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.