AdWords Data Get Through Web Service

66 views
Skip to first unread message

Pravin Yadav

unread,
May 4, 2015, 2:03:25 AM5/4/15
to adwor...@googlegroups.com
Hi,

can i  get AdWords data from asp.net web service.

if yes then what about authentication permission page.

how to store OAuth Permissions.   


raghavendra soudala

unread,
May 4, 2015, 4:39:47 PM5/4/15
to adwor...@googlegroups.com
Hi Pravin

Yes, you can! All you have to do is just create an ASP.NET service, add reference to the library, and make API calls.  For reference there is an asp.net code example in the OAuth folder of code examples in C# that might be helpful.

In addition, I'd recommend going through the .NET client library README for instructions on setting up your project.

Cheers.
Raghavendra, AdWords API Team.

Pravin Yadav

unread,
May 5, 2015, 6:35:08 AM5/5/15
to adwor...@googlegroups.com


On Tuesday, May 5, 2015 at 2:09:47 AM UTC+5:30, Raghavendra Soudala (AdWords API Team) wrote:
Hi Pravin

Yes, you can! All you have to do is just create an ASP.NET service, add reference to the library, and make API calls.  For reference there is an asp.net code example in the OAuth folder of code examples in C# that might be helpful.

In addition, I'd recommend going through the .NET client library README for instructions on setting up your project.

Cheers.
Raghavendra, AdWords API Team.


Hi,

I just try as per your above help.

My Service is return value correctly but when i consuming service that time Getting Following error:

The request failed with the error message:
--
<html><head><title>Object moved</title></head><body>
<h2>Object moved to <a href="https://accounts.google.com/o/oauth2/auth?scope=https%3a%2f%2fwww.googleapis.com%2fauth%2fadwords&state=callback&redirect_uri=http%3a%2f%2flocalhost%3a25232%2fMaiaAdWordsService.asmx&response_type=code&client_id=4516991244-33c20b7an0j8m1e1gtin9mr2l9vc46vr.apps.googleusercontent.com&access_type=offline">here</a>.</h2>
</body></html>



i.e. Request is failed (Account Permissions failed) error is known

but how to grant Account permissions at the time of consuming asp.net web service

because when it reach at account permission url then directly fire above error grant page not opened.

Even i make two services one for Authentication and second for GetData and  

call authentication in GetData Service and then try get data from GetData Service 

but not getting success.

so i need to store the Oauth 2 Permissions of Account (if yes then how to store) 

or can i fix OAuth2 Permissions(as Acceptable) to no need to visit each time Authorization URL Page

 or any other solution.
 
please reply. 
   

Raghavendra Soudala (AdWords API Team)

unread,
May 5, 2015, 5:10:13 PM5/5/15
to adwor...@googlegroups.com
Hello Pravin,

Based on the redirect_uri in the URL, it looks like the application is a native application, but it sounds like a web application would be a better fit for your use case. web application will allow you to specify a redirect URI that will receive the authorization code from the OAuth flow. Please check out the OAuth documentation on the web flow for more details. I hope this guide might also help you.

Setting access_type to offline will give you a refresh token, so you will have to prompt each user only once. After that, you can use the refresh token to get access tokens for user, and save those permissions in web.config file.

Cheers,
Raghavendra, AdWords Api Team.
Reply all
Reply to author
Forward
0 new messages