I successfully download a video performance report, but after the CampaignService get always returning null with no error and no exceptions

29 views
Skip to first unread message

ccwwmanager

unread,
Jul 20, 2019, 9:36:45 AM7/20/19
to AdWords API and Google Ads API Forum
Hello, 

i hope someone can help me.

I am successfully downloading a video performarce report and after i am trying to get more information about the campaigns. 
For this i am using the CampaignService and i am passing the ids of the campaigns from the previous report, but i always get no entries without error or exception.

I have tested to get all the campaigns, without predicates, but the result is the same.

This is my code:

 
public IEnumerable<Campaign> GetAdCampigns()
       
{


           
AdWordsUser user = new AdWordsUser(new AdWordsAppConfig()
           
{
               
DeveloperToken = "MyDeveloperToken",
               
OAuth2ClientId = "MyAccountClientId",
               
OAuth2ClientSecret = "MyAccountSecret",
               
OAuth2Mode = OAuth2Flow.APPLICATION,
               
ClientCustomerId = "MyClientCustomerId",
               
OAuth2RefreshToken = "MyOAuth2RefreshToken",
               
UserAgent = "microsoft-socialinsights:ReportDownloader:V3.2"
           
});
           
List<Campaign> campaigns = new List<Campaign>();
           
           
using (CampaignService campaignService = (CampaignService)user.GetService(AdWordsService.v201809.CampaignService))
           
{
               
Selector selector = new Selector()
               
{
                    fields
= new string[]
                   
{
                           
Campaign.Fields.Id,
                           
Campaign.Fields.Name,
                           
Campaign.Fields.StartDate,
                           
Campaign.Fields.EndDate
                   
},                                    
                    paging
= Paging.Default
               
};


               
CampaignPage page = new CampaignPage();


               
try
               
{
                   
do
                   
{
                       
// Get the campaigns.
                        page
= campaignService.get(selector);


                       
// Display the results.
                       
if (page?.entries != null)
                       
{
                            campaigns
.AddRange(page.entries);
                       
}


                        selector
.paging.IncreaseOffset();
                   
} while (selector.paging.startIndex < page.totalNumEntries);


               
}
               
catch (Exception e)
               
{
                   
throw new System.ApplicationException("Failed to retrieve campaigns by ids", e);
               
}
           
}


           
return campaigns;
       
}


I have checked the request with Fiddler and this is the request and the response:


POST https://adwords.google.com/api/adwords/cm/v201809/CampaignService HTTP/1.1
Cache-Control: no-cache, max-age=0
Authorization: Bearer ThisisMyBearer__uhmvtn_vUwhIE_4fLLfJLE4d3PFGFwg
Accept-Encoding: gzip, deflate, gzip, deflate
Request-Id: |302c1af313c1814f8aa71dfcf6376b0b.a9568c1c_4.
Content-Type: text/xml; charset=utf-8
Content-Length: 824
Host: adwords.google.com


<?xml version="1.0" encoding="UTF-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
   
<s:Header>
     
<RequestHeader xmlns="https://adwords.google.com/api/adwords/cm/v201809">
         
<clientCustomerId>594-834-3247</clientCustomerId>
         <developerToken>MyDeveloperToken__EaiBWNDw8W6A</
developerToken>
         
<userAgent>microsoft-socialinsights:ReportDownloader:V3.2 (AwApi-DotNet/24.7.0, Common-Dotnet/9.5.0, .NET CLR/4.0.30319.42000, , gzip)</userAgent>
     
</RequestHeader>
   </
s:Header>
   
<s:Body xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
     
<get xmlns="https://adwords.google.com/api/adwords/cm/v201809">
         
<serviceSelector>
           
<fields>Id</fields>
            <fields>Name</
fields>
           
<fields>StartDate</fields>
            <fields>EndDate</
fields>
           
<paging>
               
<startIndex>0</startIndex>
               <numberResults>500</
numberResults>
           
</paging>
         </
serviceSelector>
     
</get>
   </
s:Body>
</s:Envelope>


<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http:/
/schemas.xmlsoap.org/soap/envelope/">
   <soap:Header>
      <ResponseHeader xmlns="
https://adwords.google.com/api/adwords/cm/v201809">
         
<requestId>00058e05935762030a374e58980e9328</requestId>
         <serviceName>CampaignService</
serviceName>
         
<methodName>get</methodName>
         <operations>1</
operations>
         
<responseTime>160</responseTime>
      </
ResponseHeader>
   
</soap:Header>
   <soap:Body>
      <getResponse xmlns="https:/
/adwords.google.com/api/adwords/cm/v201809">
         <rval>
            <totalNumEntries>0</totalNumEntries>
            <Page.Type>CampaignPage</Page.Type>
         </rval>
      </getResponse>
   </soap:Body>
</soap:Envelope>


Any idea what it is wrong?

Thank you in advance,


Rafael Sánchez


ccwwmanager

unread,
Jul 24, 2019, 6:35:13 AM7/24/19
to AdWords API and Google Ads API Forum
I answer myself:

The following campaign types are available in the UI but are not currently supported in the API:


Google Ads API Forum Advisor Prod

unread,
Jul 24, 2019, 9:49:36 PM7/24/19
to adwor...@googlegroups.com

Hi Rafael, 

My apologies for the inconvenience.

You are correct that the video campaign is currently not supported in any AdWords services and this is the reason why you got empty result using the CampaignService.

Please continue to follow our blog to receive future updates and new releases.

Thanks and regards,
Ejay
Google Ads API Team



ref:_00D1U1174p._5001UEFZIw:ref
Reply all
Reply to author
Forward
0 new messages