Hi Kemeleon,
Since you have set the credentials in auth.ini, could you try not
passing anything to the constructor?
$user = new AdWordsUser();
$user->LogDefaults();
$targetingIdeaService = $user- >GetTargetingIdeaService('v201008');
To answer your other question,
When you are making calls to the sandbox server (https://adwords-
sandbox.google.com), you should have
email = your_gmail_address
password = your_gmail_password
clientEmail = client_1+your_gmail_address
developerToken = your_gmail_address++EUR (or the appropriate currency
code).
when making calls to production (https://adwords.google.com), you have
to substitute them with your adwords MCC email/password, adwords
account email and your approved developer token.
Cheers,
Anash P. Oommen,
AdWords API Advisor.
On Oct 7, 2:20 pm, drkameleon <[email protected]> wrote:
> OK. Now I'm getting the following error :
>
> AuthenticationError.NOT_ADS_USER @ ; trigger:'852172376667'
> Service[TargetingIdeaService.get]
>
> ---------------------------------------------------------------------------
> ----
> This is my AUTH.INI :
>
> email = "[email protected]"
> password = "EMAIL_PASSWORD"
> userAgent = "silverseo"
> applicationToken = "ignored"
> developerToken = "[email protected]++eur"
>
> ; Uncomment to make requests against a client account.
> clientId = "[email protected]"
>
> ** NOTE I just have a gmail + adwords account / I haven't done
> anything else - should I?
> ---------------------------------------------------------------------------
> ----
> This is my SETTINGS.INI :
>
> [LOGGING]
>
> PATH_RELATIVE = "1"
> LIB_LOG_DIR_PATH = "../../../../../../logs"
>
> [SERVER]
> DEFAULT_VERSION = "v201008"
>
> DEFAULT_SERVER = "https://adwords-sandbox.google.com"
>
> [SOAP]
>
> COMPRESSION = 1
>
> COMPRESSION_LEVEL = 1
>
> WSDL_CACHE = 0
>
> [PROXY]
>
> [AUTH]
>
> ---------------------------------------------------------------------------
> ----
> And this is my code :
>
> function getMonthlyLocalSearches($kw)
> {
> error_reporting(E_STRICT | E_ALL);
>
> try
> {
> // Get AdWordsUser from credentials in "../auth.ini"
> // relative to the AdWordsUser.php file's directory.
> $user = new
> AdWordsUser(NULL,"[email protected]","EMAIL_PASSWORD");
>
> // Log SOAP XML request and response.
> $user->LogDefaults();
>
> // Get the TargetingIdeaService.
> $targetingIdeaService = $user-
>
> >GetTargetingIdeaService('v201008');
>
> // Create seed keyword.
> $keyword = new Keyword();
> $keyword->text = $kw;
> $keyword->matchType = 'EXACT';
>
> // Create selector.
> $selector = new TargetingIdeaSelector();
> $selector->requestType = 'IDEAS';
> $selector->ideaType = 'KEYWORD';
> $selector->requestedAttributeTypes =
> array('AVERAGE_TARGETED_MONTHLY_SEARCHES',
> 'GLOBAL_MONTHLY_SEARCHES');
>
> $paging = new Paging();
> $paging->startIndex = 0;
> $paging->numberResults = 10;
> $selector->paging = $paging;
>
> // Create keyword match type search parameter to ensure
> unique results.
> $keywordMatchTypeSearchParameter = new
> KeywordMatchTypeSearchParameter();
> $keywordMatchTypeSearchParameter->keywordMatchTypes =
> array('EXACT');
>
> $selector->searchParameters =
> array($keywordMatchTypeSearchParameter);
>
> // Get related keywords.
> $page = $targetingIdeaService->get($selector);
>
> if (isset($page->entries))
> {
> foreach ($page->entries as $targetingIdea)
> {
> $data = MapUtils::GetMap($targetingIdea->data);
> $keyword = $data['KEYWORD']->value;
> $averageMonthlySearches =
> isset($data['AVERAGE_TARGETED_MONTHLY_SEARCHES']->value)
>
> ? $data['AVERAGE_TARGETED_MONTHLY_SEARCHES']->value : 0;
>
> printf("Keyword with text '%s', match type '%s',
> and average monthly "
> . "search volume '%s' was found.\n", $keyword->text,
>
> $keyword->matchType, $averageMonthlySearches);
> }
> }
> else
> {
> print "No related keywords were found.\n";
> }
> }
> catch (Exception $e)
> {
> print $e->getMessage();
> }
> }
>
> -------------------------------------------------------------------
> Please tell me what I'm doing wrong - please do not point me to
> another article - I've read almost all of them
>
> Thanks!
>
> Dr.Kameleon
>
> On Oct 6, 8:34 pm, drkameleon <[email protected]> wrote:
>
>
>
> > Hi everyone,
>
> > could somebody tell me what EXACTLY i have to use in the place of the
> > variables.... ($email, etc, etc) - it keeps throwing the same error
> > again and again.
>
> > $user = new AdWordsUser(NULL, $email, $password, $developerToken,
> > $applicationToken, $userAgent, $clientId);
>
> > Please, it's URGENT.
>
> > Thanks a lot!
>
> > Dr.Kameleon
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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