-
Notifications
You must be signed in to change notification settings - Fork 211
PhpSampleCode
The PHP sample code is available for browsing in the repository, and can also be downloaded in a ZIP file.
Using this sample code requires that you already have an OAuth 2.0 access token. To authorize an access token from a PHP application, use the Google APIs Client Library for PHP. For testing, you can acquire an access token with oauth2.py.
The download ZIP file contains a copy of the Zend framework libraries. Alternatively, you can download the Zend framework from zend.com, or install it with your system's software package manager.
Download the sample code package from here, unzip it, and make sure the oauth2-php-sample is in a web-accessible directory.
Visit http://<yourserver>
/oauth2-php-samples/oauth2.php to run the OAuth 2.0 sample. Enter a Gmail email address and an access token that is authorized to access that account, then click Submit. You should see an output of the count of messages in your inbox along with the subject lines of the emails.
The high-level sample code is in Github along with plenty of comments.