Hello Raul,
thanks :D
You can find the DeveloperKey in the Google API Console, in the tab
'API Access':
https://code.google.com/apis/console/
At the end of the API Access page there is a box named Simple API
Access, API key is what you are looking for.
The DeveloperKey is meant to be used for request that need to be
signed but don't need authorization; for the AdSense Management API,
every request needs to be authorized, so the Key is not enough to send
requests.
About the error, you need to create the database 'example.sqlite',
looks like you didn't, the docs of the class 'AdSenseAuth' explain
what you need to do:
http://code.google.com/p/google-api-php-client/source/browse/trunk/examples/adsense/AdSenseAuth.php#29
The answer for the redirect URI question is yes, every user will have
to create a project in the Google API Console, create a client id for
web application, set their redirect URI and Javascript Origins.
Last reply: yes, the offline access is meant exactly for that use
case. If you use the Google API PHP Client Library, is enabled by
default:
http://code.google.com/p/google-api-php-client/source/browse/trunk/src/auth/apiOAuth2.php#36
Cheers,
Silvano
--
Silvano Luciani | Developer Programs Engineer
Google UK Limited
Registered Office: Belgrave House, 76 Buckingham Palace Road, London
SW1W 9TQ
Registered in England Number: 3977902
On Feb 29, 6:52 am, Raúl Mellado <
raulmell...@gmail.com> wrote:
> Hi everybody (specially to Silvano who kindly answers all of our
> questions),
>
> I am trying to develop a Wordpress plugin (in PHP) that will show, in
> the backend, earnings for a current blog (filtering per custom channels)
> using Management API. I am very new to Google Apis and OAuth, so I am a bit
> lost :-)
>
> The first thing I did was to download the package api-php-client
> (current version 0.4.9) fromhttp://
code.google.com/p/google-api-php-client/downloads/list.
>
> I first tried the tasks example and made it work, creating a project in
> Google APIs section, well done for me! :-)
>
> Now I tried the Adsense example; I created a new project in the Google
> APIs, updated the example php code with my data (first difference I noticed
> was that there is this additional
> code: $this->apiClient->setDeveloperKey('YOUR_DEVELOPER_KEY_HERE');, could
> you add some light on where I can get my developer key?).
>
> When I upload the code to my server and
> load /examples/adsense/index.php, I get the message:
>
> *Fatal error*: Call to a member function execute() on a non-object in *
> /public_html/gapis/examples/adsense/AdSenseAuth.php* on line *131*