Hi,
I'm using the experimental Branch. When I try to get all campaigns i get 0 results but I have campaigns on my test account. My code is as following:
------------------------------------------------------------------------------------------
$oAuth2Credential = (new OAuth2TokenBuilder())
->fromFile(drupal_get_path('module', 'rcv_api') . '/extras/adsapi_php.ini')
->build();
$session = (new AdWordsSessionBuilder())
->fromFile(drupal_get_path('module', 'rcv_api') . '/extras/adsapi_php.ini')
->withOAuth2Credential($oAuth2Credential)
->build();
//
$adWordsServices = new AdWordsServices();
$campaignService = $adWordsServices->get($session, 'CampaignService', 'v201605', 'cm');
// Create selector.
$selector = new Selector();
$selector->setFields(array('Id', 'Name'));
$selector->setOrdering(array(new OrderBy('Name', 'ASCENDING')));
// Create paging controls.
$selector->setPaging(new Paging(0, 100));
// Make the get request.
$page = $campaignService->get($selector);
------------------------------------------------------------------------------------------
Here are my campaigns:

------------------------------------------------------------------------------------------
I tried to debug some and i found on the page dump the following information about request:
-- I'm using the experimental Branch. When I try to get all campaigns i get 0 results but I have campaigns on my test account. My code is as following:
------------------------------------------------------------------------------------------
$oAuth2Credential = (new OAuth2TokenBuilder())
->fromFile(drupal_get_path('module', 'rcv_api') . '/extras/adsapi_php.ini')
->build();
$session = (new AdWordsSessionBuilder())
->fromFile(drupal_get_path('module', 'rcv_api') . '/extras/adsapi_php.ini')
->withOAuth2Credential($oAuth2Credential)
->build();
//
$adWordsServices = new AdWordsServices();
$campaignService = $adWordsServices->get($session, 'CampaignService', 'v201605', 'cm');
// Create selector.
$selector = new Selector();
$selector->setFields(array('Id', 'Name'));
$selector->setOrdering(array(new OrderBy('Name', 'ASCENDING')));
// Create paging controls.
$selector->setPaging(new Paging(0, 100));
// Make the get request.
$page = $campaignService->get($selector);
------------------------------------------------------------------------------------------
Here are my campaigns:
------------------------------------------------------------------------------------------
I tried to debug some and i found on the page dump the following information about request:
["location"]=> string(70) "https://adwords.google.com/api/adwords/cm/v201605/CampaignService?wsdl" ["__last_request"]=> string(934) "<?xml version="1.0" encoding="UTF-8"?> ************************ (AwApi-PHP, googleads-php-lib/1.3.1-beta, PHP/7.0.4)falsefalseIdNameNameASCENDING0100 " ["httpsocket"]=> resource(587) of type (stream) ["_use_proxy"]=> int(0) ["httpurl"]=> resource(588) of type (SOAP URL) ["__last_request_headers"]=> string(312) "POST /api/adwords/cm/v201605/CampaignService?wsdl HTTP/1.1 Host: adwords.google.com Connection: Keep-Alive User-Agent: PHP-SOAP/7.0.4 Content-Type: text/xml; charset=utf-8 SOAPAction: "" Content-Length: 934 Authorization: ************************ " ["__last_response_headers"]=> string(364) "HTTP/1.1 200 OK Content-Type: text/xml; charset=UTF-8 Date: Mon, 19 Sep 2016 07:27:42 GMT Expires: Mon, 19 Sep 2016 07:27:42 GMT Cache-Control: private, max-age=0 X-Content-Type-Options: nosniff X-Frame-Options: SAMEORIGIN X-XSS-Protection: 1; mode=block Server: GSE Alt-Svc: clear Accept-Ranges: none Vary: Accept-Encoding Transfer-Encoding: chunked " ["__last_response"]=> string(578) "<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Header><ResponseHeader xmlns="https://adwords.google.com/api/adwords/cm/v201605"><requestId>************************</requestId><serviceName>CampaignService</serviceName><methodName>get</methodName><operations>1</operations><responseTime>82</responseTime></ResponseHeader></soap:Header><soap:Body><getResponse xmlns="https://adwords.google.com/api/adwords/cm/v201605"><rval><totalNumEntries>0</totalNumEntries><Page.Type>CampaignPage</Page.Type></rval></getResponse></soap:Body></soap:Envelope>" }Can anyone help? Thank you
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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+unsubscribe@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+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-api/afb50964-9c8f-44c6-a46f-bf7b7e45687e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment