Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Laravel News:
Using the Google API with Socialite
Apr 11, 2017 @ 14:47:36

On the Laravel News site there's a new tutorial posted showing you how to use the Socialite package with the Google API to connect a user's account and get a list of their contacts.

When I start a project that requires users to log in using their Google accounts, I immediately turned to Laravel Socialite. Socialite is one of Laravel’s official packages, but it is clear it only handles user authentication, making its use not as dynamic as I had hoped it would be. While I needed users to log in, I also needed to get a list of their Google Contacts. In this post, I’ll show you how I was able to query a list of contacts from Google’s People API and keep using Socialite.

They start with a basic guide to creating an application on the Google API Console and what information you'll need (credentials) to allow your application to connect. Then, using the Google API Client for PHP and the functionality built into Socialite they create the approval flow and how to handle refresh tokens should your token expire.

tagged: tutorial laravel socialite contacts google api token

Link: https://laravel-news.com/google-api-socialite

SitePoint PHP Blog:
Best Practices REST API from Scratch – Implementation
Jul 24, 2014 @ 18:11:22

PHPMaster.com has posted the second part of their best practices in REST APIs series with this new post focusing more on the implementation part of things.

We ended the first part of this tutorial with all the basic layers of our API in place. We have our server setup, authentication system, JSON input/output, error management and a couple of dummy routes. But, most importantly, we wrote the README file that defines resources and actions. Now it’s time to deal with these resources.

They move on and add more functionality for creating (POST) and updating (PUT/PATCH) contacts in the system. They also show how to list contacts and add in some search handling allowing for sorting and returning only certain data. There's also some code for pagination handling, locating a single contact record, basic caching and simple rate limiting.

tagged: rest bestpractices api tutorial implementation contacts

Link: http://www.sitepoint.com/best-practices-rest-api-scratch-implementation/

Script-Tutorials.com:
Google API - Get contact list
Jul 26, 2012 @ 14:26:27

In this new tutorial on the Script-Tutorials.com site, they show you how to use the Google API (and OAuth) to access contacts information from your Gmail account.

In our new tutorial I am going to tell you about inviting friends. I think that this is the most important part for every website, a key to success. Today I will show you how to create simple and effective Gmail contact importer using OAuth authorization and API. Also, I will tell about obtaining Google API access too.

Screenshots show you how to get to the access token information you'll need to connect and the full code is included to help you get authenticated and pull down the contacts list to display in the page's HTML output.

tagged: tutorial google gmail api oauth key contacts

Link:

9Lessons:
Import GMail Contacts Google OAuth Connect with PHP
Jun 17, 2011 @ 16:11:15

In a recent post to the 9Lessons.info site, Srinivas Tamada shows you how to connect Gmail with your system to import contacts via the magic of OAuth (pulled from Gmail to you).

Inviting friends is the most important part of the web project success. This post explains you how to import Gmail contacts from address book via Google open authorization protocol connect with PHP. It’s simple just few configurations follow below four steps, use this script and give option to invite more friends.

Following a few simple steps and using this simple script - registering the domain under Google Accounts, verify ownership and use the OAuth consumer and secret keys in the script. It's then simple to grab the contacts and output their details as the "Contacts.php" example script shows.

tagged: gmail contacts oauth connection tutorial export

Link:


Trending Topics: