AdWordsAppConfig config = user.Config as AdWordsAppConfig;
config.OAuth2Mode = OAuth2Flow.APPLICATION;
config.OAuth2ClientId = "XXXXXXX.apps.googleusercontent.com";
config.OAuth2ClientSecret = "SDSGDFGDFSGDFSGDFSGDSFGD";
config.DeveloperToken = "AAAAAAAAAAAAAAAAAAAAAAAA";
config.ClientCustomerId = "123-456-7890";
config.Email = "XXX...@gmail.com";
config.Password = "$#$#$#$";
config.OAuth2RefreshToken = "XXXXXXXXXXXDDDDDDDDDDDDSSSSSSSSn6zK6XiATCKT";
// Get the CampaignService.
CampaignService campaignService = (CampaignService)user.GetService(AdWordsService.v201506.CampaignService);
// Create the selector.
Selector selector = new Selector();
selector.fields = new string[] { "Id", "Name" };
// Set the selector paging.
selector.paging = new Paging();
int offset = 0;
int pageSize = 500;
CampaignPage page = new CampaignPage();
try
{
do
{
selector.paging.startIndex = offset;
selector.paging.numberResults = pageSize;
// Get the campaigns.
page = campaignService.get(selector);
Console.WriteLine(page.totalNumEntries.ToString());
// Display the results.
if (page != null && page.entries != null)
{
int i = offset;
foreach (Campaign campaign in page.entries)
{
Console.WriteLine("{0}) Campaign with id = '{1}', name = '{2}' " +
" was found.", i + 1, campaign.id, campaign.name, campaign.status);
i++;
}
}
offset += pageSize;
} while (offset < page.totalNumEntries);
Console.WriteLine("Number of campaigns found: {0}", page.totalNumEntries);
}
catch (Exception ex)
{
Console.WriteLine( "Failed to retrieve campaigns"+ ex.Message.ToString() );
}
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 adwor...@googlegroups.com
To unsubscribe from this group, send email to
adwords-api...@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 a topic in the Google Groups "AdWords API Forum" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/adwords-api/IxqH423lPJY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to adwords-api...@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/db54c89a-de38-46a5-bd46-551eba706027%40googlegroups.com.
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 adwor...@googlegroups.com
To unsubscribe from this group, send email to
adwords-api...@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 a topic in the Google Groups "AdWords API Forum" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/adwords-api/IxqH423lPJY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to adwords-api...@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/f8a5de17-0aea-410f-9646-5425d89590c3%40googlegroups.com.