My favorites | Sign in
Project Home Downloads Issues Source
Project Information
Members
Featured
Downloads

Google+ PHP API Starter Project

This starter project demonstrates use of the Google+ APIs and development best practices. You can use it as a starting point for building your own Google+ applications.

Getting Started

Once you're ready to dive in to the code simply download the zip archive and follow the README instructions included with the project or follow the instructions below.

  1. Visit the Google API Console to generate your developer key, OAuth2 client id, OAuth2 client secret, and register your OAuth2 redirect uri.
    • From the "Services" screen, activate access to "Google+ API".
    • Click on "API Access" in the left column
    • Click the button labeled "Create an OAuth2 client ID"
    • Give your application a name and click "Next"
    • Select "Web Application" as the "Application type"
    • click "Create client ID"
    • click "Edit..." for your new client ID
    • Under the callback URL, enter the fully qualified URL for your PHP application (example http://localhost/googleplus/index.php).
  2. Download the latest version of the google-api-php-client library.
  3. mkdir googleplus && cd googleplus
    curl -O "http://google-api-php-client.googlecode.com/files/google-api-php-client-0.5.0.tar.gz"
    tar -xvf  google-api-php-client-0.5.0.tar.gz
    curl -O https://google-plus-php-starter.googlecode.com/svn/trunk/index.php
    curl -O https://google-plus-php-starter.googlecode.com/svn/trunk/style.css
  4. Edit index.php with the redirect uri, consumer key, secret, and developer key you obtained in step 1.
    • Update 'insert_your_oauth2_client_id' with your oauth2 client id.
    • Update 'insert_your_oauth2_client_secret' with your oauth2 client secret.
    • Update 'insert_your_oauth2_redirect_uri' with the fully qualified redirect URI.
    • Update 'insert_your_developer_key' with your developer key. This is listed under "Simple API Access" at the very bottom in the Google API Console
  5. Visit http://localhost/googleplus/index.php

Related Resources

Powered by Google Project Hosting