• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 857
  • Last Modified:

What is the client_email, developer_token, useragent and application_token in adword api?

Hi, I try learn more about google API and I get the code you see in code snippet for I made a test and closer to the tool.
I have doubts about this part of the code:
 $email = 'INSERT_LOGIN_EMAIL_HERE';
 $password = 'INSERT_PASSWORD_HERE';
 $client_email = 'INSERT_CLIENT_LOGIN_EMAIL_HERE';
 $useragent = 'INSERT_COMPANY_NAME: AdWords API PHP Sample Code';
 $developer_token = 'INSERT_DEVELOPER_TOKEN_HERE';
 $application_token = 'INSERT_APPLICATION_TOKEN_HERE';

I have account in google adwords. So email and password can be the same I use for login in my adwords account, right?
The client_email is the same of my e-mail?
How I get useragent, developer_token and application_token.

Regards, JC
<?php
 // Copyright 2008, Google Inc. All Rights Reserved.
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
 // You may obtain a copy of the License at
 //
 // http://www.apache.org/licenses/LICENSE-2.0
 //
 // Unless required by applicable law or agreed to in writing, software
 // distributed under the License is distributed on an "AS IS" BASIS,
 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
 /** This code sample retrieves variations for a seed keyword. */
 
 require_once('soapclientfactory.php');
 
 # Provide AdWords login information.
 $email = 'INSERT_LOGIN_EMAIL_HERE';
 $password = 'INSERT_PASSWORD_HERE';
 $client_email = 'INSERT_CLIENT_LOGIN_EMAIL_HERE';
 $useragent = 'INSERT_COMPANY_NAME: AdWords API PHP Sample Code';
 $developer_token = 'INSERT_DEVELOPER_TOKEN_HERE';
 $application_token = 'INSERT_APPLICATION_TOKEN_HERE';
 
 # Define SOAP headers.
 $headers =
 '<email>' . $email . '</email>'.
 '<password>' . $password . '</password>' .
 '<clientEmail>' . $client_email . '</clientEmail>' .
 '<useragent>' . $useragent . '</useragent>' .
 '<developerToken>' . $developer_token . '</developerToken>' .
 '<applicationToken>' . $application_token . '</applicationToken>';
 
 # Set up service connection. To view XML request/response, change value of
 # $debug to 1. To send requests to production environment, replace
 # "sandbox.google.com" with "adwords.google.com".
 $namespace = 'https://sandbox.google.com/api/adwords/v12';
 $keyword_tool_service = SoapClientFactory::GetClient(
 $namespace . '/KeywordToolService?wsdl', 'wsdl');
 $keyword_tool_service->setHeaders($headers);
 $debug = 0;
 
 # Create seed keyword structure.
 $seed_keyword =
 '<negative>false</negative>' .
 '<text>mars cruise</text>' .
 '<type>Broad</type>';
 $use_synonyms = '<useSynonyms>true</useSynonyms>';
 
 # Get keyword variations.
 $request_xml =
 '<getKeywordVariations>' .
 '<seedKeywords>' . $seed_keyword . '</seedKeywords>' .
 $use_synonyms .
 '<languages>en</languages>' .
 '<countries>US</countries>' .
 '</getKeywordVariations>';
 $variation_lists =
 $keyword_tool_service->call('getKeywordVariations', $request_xml);
 $variation_lists = $variation_lists['getKeywordVariationsReturn'];
 if ($debug) show_xml($keyword_tool_service);
 if ($keyword_tool_service->fault) show_fault($keyword_tool_service);
 
 # Display keyword variations.
 $to_consider = $variation_lists['additionalToConsider'];
 echo 'List of additional keywords to consider has ' . count($to_consider) .
 ' variation(s).' . "\n";
 
 $more_specific = $variation_lists['moreSpecific'];
 echo 'List of popular queries with given seed has ' . count($more_specific) .
 ' variation(s).' . "\n";
 
 function show_xml($service) {
 echo $service->request;
 echo $service->response;
 echo "\n";
 }
 
 function show_fault($service) {
 echo "\n";
 echo 'Fault: ' . $service->fault . "\n";
 echo 'Code: ' . $service->faultcode . "\n";
 echo 'String: ' . $service->faultstring . "\n";
 echo 'Detail: ' . $service->faultdetail . "\n";
 exit(0);
 }
 ?>

Open in new window

0
Pedro Chagas
Asked:
Pedro Chagas
1 Solution
 
Mahdii7Commented:
Please visit: http://code.google.com/apis/adwords/docs/developer/index.html#adwords_api_intro_signing

Then sign up for an API Developer account. After you do this, you will know exactly what to enter in each of the required login fields. This is different than your AdWords account information, and it will supply you with the needed information (eg. developer tokens).

Good luck
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now