Hi,

Thanks for sending over the screenshot. The alerts you highlighted are not 
covered by the AlertService (they don't fall into any of the categories 
listed for AlertService.AlertQuery#types 
<https://developers.google.com/adwords/api/docs/reference/v201406/AlertService.AlertQuery#types>),
 
so you won't be able to retrieve those via the API.

Best regards,
Josh, AdWords API Team

On Tuesday, September 2, 2014 3:42:24 PM UTC-4, Josh Radcliff (AdWords API 
Team) wrote:
>
> Hi,
>
> You mentioned "I see two alerts from AdWOrds Account (not MCC account)." 
> -- could you tell me what type of alerts they are? You can send screenshots 
> only to me by clicking *Reply to Author*. As I mentioned in my prior 
> post, though, the AlertService will not return every type of alert that you 
> see in the UI, so you won't be able to duplicate the alert list completely 
> using the API.
>
> Thanks,
> Josh, AdWords API Team
>
> On Monday, September 1, 2014 6:20:17 AM UTC-4, Athlan wrote:
>>
>> Thank you for reply.
>>
>> On Thursday, August 28, 2014 6:43:11 PM UTC+2, Josh Radcliff (AdWords API 
>> Team) wrote:
>>>
>>> Hi,
>>>
>>> For issue #1, the error you are encountering means that the $clientId 
>>> you are passing here:
>>>
>>> $alertQuery->clientCustomerIds = array($clientId);
>>>
>>> Is either:
>>>
>>> a) Not an existing AdWords customer ID, or
>>> b) Not an AdWords customer ID to which the request's OAuth credentials 
>>> has access
>>>
>>
>> I am sure about both. Customer ID exists in the system, because it is 
>> obtained from CustomerService which is accessed via valid OAuth 
>> credentials. Customer ID is a 10 digit idntifier.
>>  
>>
>>>
>>> Regarding the second method, the AlertService only returns a subset of 
>>> the alert types that you see in the UI.
>>>
>>
>> I have mentioned all avaliable types and severities in example.
>>  
>>
>>> Which types of alerts are you seeing in the UI?
>>>
>>
>> I see two alerts from AdWOrds Account (not MCC account).
>>
>> What I want is read alerts from all users that allows app via OAuth2 to 
>> access account.
>>  
>>
>>>
>>> Thanks,
>>> Josh, AdWords API Team
>>>
>>> On Thursday, August 28, 2014 9:54:06 AM UTC-4, Athlan wrote:
>>>>
>>>> Howdy,
>>>>
>>>> I have notices two issues related with googleads-php-lib.
>>>>
>>>>    1. There is no possibility to query alert service from php library 
>>>>    passing clientId, because exception is thrown (in response you can 
>>>> notice 
>>>>    clientId = 0 - why?).
>>>>    2. There is no possibility to query alert service from MCC account 
>>>>    with customers, that authorized the app via OAuth2.
>>>>
>>>>
>>>> I have an app that authorizes users via OAuth2 and uses MCC's user 
>>>> developer key. Everyone who allows application to get into their data, 
>>>> allows to generate on-demand reports, browse the ads configuration etc. 
>>>> But 
>>>> in AlertService there is no entries. The example 
>>>> <https://github.com/googleads/googleads-php-lib/blob/master/examples/AdWords/v201406/AccountManagement/GetAccountAlerts.php>
>>>>  
>>>> also returns no entries. My code:
>>>>
>>>> $ADWORDS_VERSION = 'v201406';
>>>> // Get the service, which loads the required classes.
>>>> $service = $client->GetService('AlertService', $ADWORDS_VERSION);
>>>>
>>>>
>>>> $clientId = (int) 'ClientIdWithoutDashes';
>>>> //$clientId = 'ClientIdWithoutDashes'; // i have tried this also...
>>>>
>>>>
>>>> $alertQuery = new \AlertQuery();
>>>> $alertQuery->clientSpec = "ID_LIST";
>>>> $alertQuery->clientCustomerIds = array($clientId);
>>>> $alertQuery->filterSpec = 'ALL';
>>>> $alertQuery->types = array('ACCOUNT_BUDGET_BURN_RATE',
>>>> 'ACCOUNT_BUDGET_ENDING',
>>>>     'ACCOUNT_ON_TARGET','CAMPAIGN_ENDED','CAMPAIGN_ENDING',
>>>>     'CREDIT_CARD_EXPIRING','DECLINED_PAYMENT',
>>>>     'MANAGER_LINK_PENDING','MISSING_BANK_REFERENCE_NUMBER',
>>>>     'PAYMENT_NOT_ENTERED','TV_ACCOUNT_BUDGET_ENDING',
>>>> 'TV_ACCOUNT_ON_TARGET',
>>>>     'TV_ZERO_DAILY_SPENDING_LIMIT','USER_INVITE_ACCEPTED',
>>>>     'USER_INVITE_PENDING','ZERO_DAILY_SPENDING_LIMIT');
>>>> $alertQuery->severities = array('GREEN', 'YELLOW', 'RED');
>>>> $alertQuery->triggerTimeSpec = 'ALL_TIME';
>>>>
>>>>
>>>> // Create selector.
>>>> $selector = new \AlertSelector();
>>>> $selector->query = $alertQuery;
>>>>
>>>>
>>>> // Create paging controls.
>>>> $selector->paging = new \Paging(0, \AdWordsConstants::
>>>> RECOMMENDED_PAGE_SIZE;);
>>>>
>>>>
>>>> $result = [];
>>>> $i = 0;
>>>>
>>>>
>>>> do {
>>>>   // Make the get request.
>>>>   $page = $service->get($selector);
>>>>   
>>>>   // Display results.
>>>>   if (isset($page->entries)) {
>>>>     foreach ($page->entries as $entry) {
>>>>       $result[] = $entry;
>>>>     }
>>>>   } else {
>>>>     // No entries were found.
>>>>   }
>>>>   
>>>>   // Advance the paging index.
>>>>   $selector->paging->startIndex += $itemsPerPage;
>>>> }
>>>> while ($page->totalNumEntries > $selector->paging->startIndex);
>>>>
>>>>
>>>> return $result;
>>>>
>>>> I have tried passing $clientId as integer, as Paul Matthews (AdWords 
>>>> API Team) written 
>>>> <https://groups.google.com/d/msg/adwords-api/DRjtU7XSRMU/_Q7HfS0P8lkJ> 
>>>> and as string with and without dashes.
>>>>
>>>> I am receiving exception:
>>>> [AlertError.INVALID_CLIENT_ID_SELECTED @ selector.query.
>>>> clientExternalCustomerIds[0]]
>>>>
>>>> In respons you can see that customerId is equal zero, while I have 
>>>> passed an value...
>>>>
>>>> While I am using this method:
>>>>
>>>> $alertQuery = new \AlertQuery();
>>>> $alertQuery->clientSpec = 'ALL';
>>>> $alertQuery->filterSpec = 'ALL';
>>>> $alertQuery->types = array('ACCOUNT_BUDGET_BURN_RATE',
>>>> 'ACCOUNT_BUDGET_ENDING',
>>>>     'ACCOUNT_ON_TARGET','CAMPAIGN_ENDED','CAMPAIGN_ENDING',
>>>>     'CREDIT_CARD_EXPIRING','DECLINED_PAYMENT',
>>>>     'MANAGER_LINK_PENDING','MISSING_BANK_REFERENCE_NUMBER',
>>>>     'PAYMENT_NOT_ENTERED','TV_ACCOUNT_BUDGET_ENDING',
>>>> 'TV_ACCOUNT_ON_TARGET',
>>>>     'TV_ZERO_DAILY_SPENDING_LIMIT','USER_INVITE_ACCEPTED',
>>>>     'USER_INVITE_PENDING','ZERO_DAILY_SPENDING_LIMIT');
>>>> $alertQuery->severities = array('GREEN', 'YELLOW', 'RED');
>>>> $alertQuery->triggerTimeSpec = 'ALL_TIME';
>>>>
>>>>
>>>> I am receiving no alerts, while a few exists.
>>>>
>>>> I have also tried set customerId in client:
>>>>
>>>> $client->SetClientCustomerId( ... ); // as in reporting service, 
>>>> wherethis method works
>>>>
>>>> What's going on?
>>>>
>>>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 [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
--- 
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 [email protected].
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/7f2988c3-4ae2-4567-9290-d2a700542c4b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to