Hey group,
I could able to get account details using
(ServicedAccountService)user.GetService(AdWordsService.v201101.ServicedAccountService);
but i'm unable to get details of followings:
AdGroupService adGroupService =
(AdGroupService)user.GetService(AdWordsService.v201101.AdGroupService);
--> GetAllAds.cs
CampaignService campaignService =(CampaignService)user.
GetService(AdWordsService.v201101.CampaignService);-->
GetAllCampaigns.cs
could you please help to identify what i'm missing from attached file?
code snip-shot :
// Get the AdGroupAdService.
AdGroupService adGroupService =
(AdGroupService)user.GetService(AdWordsService.v201101.AdGroupService);
long campaignId = long.Parse(("66098546"));
// Create a selector and set the filters.
Selector selector = new Selector();
// Set the fields to select.
selector.fields = new string[] { "Id", "Name" };
// Set a filter condition.
Predicate predicate = new Predicate();
predicate.field = "CampaignId";
predicate.@operator = PredicateOperator.EQUALS;
predicate.values = new string[] { campaignId.ToString() };
selector.predicates = new Predicate[] { predicate };
string getDetails = null;
try
{
AdGroupPage page = adGroupService.get(selector);
if (page != null && page.entries != null)
{
foreach (AdGroup adGroup in page.entries)
{
getDetails += "Ad id is {0} and status is {1}
<br>" + adGroup.name + "<br>" + adGroup.id + "<hr>";
}
}
else
{
getDetails += "Nothing found";
}
}
catch (Exception ex)
{
getDetails += "Failed to get Ad(s). Exception says
\"{0}\"<br>" + ex.Source + "<br>" + ex.InnerException +"<br>"+ ex.Data
+"<br>"+ ex.HelpLink;
}
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
http://adwordsapi.blogspot.com
http://groups.google.com/group/adwords-api
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en