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:
["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