Google API Oauth 2 with Installed App - google-api

I am using Google API OAuth 2.0 for Installed Applications & php. This is a WordPress plugin we are updating, and it was recommended to us by Google support to use Installed App instead of Web App "because you will then have a single Project ID, your users won't need to create their own using the APIs Console"
I am wrestling a bit to get the proper setup for this - Web App samples were easy enough, but I cannot find a single example of the code setup for creating these:
https://developers.google.com/accounts/docs/OAuth2InstalledApp#formingtheurl
It says I should use "code" & "grant_type", but I don't see any functions in the apiClient to set these.
As I'm prolly not being very clear, what I'm looking for is the equivalent of this:
$client->setClientId();
$client->setClientSecret();
$client->setRedirectUri();
$client->setDeveloperKey();
$client->setScopes(array('https://www.googleapis.com/auth/analytics.readonly'));
For Installed Apps.
Thanks!

The Google Drive SDK documentation includes a step-by-step quickstart sample that uses OAuth 2.0 for Installed Applications:
https://developers.google.com/drive/quickstart
This is the code you are looking for:
$client->setClientId('YOUR_CLIENT_ID');
$client->setClientSecret('YOUR_CLIENT_SECRET');
$client->setRedirectUri('urn:ietf:wg:oauth:2.0:oob');
$client->setScopes(array('https://www.googleapis.com/auth/analytics.readonly'));

Related

Is there an API of all enabled APIs in Google console?

I would like to get a list of all the APIs, which are enabled for my project in Google Developer Console. Is there any way?
PS: I know there is a Google Discovery API, which can be used. But I would rather not apply a filter myself.
The discovery services API returns a list of all available Google APIs and has nothing to do with your project on Google Developer console.
There is not currently an API that will give you access to the enabled APIs within a project on Google Developers console. You will have to check manually on the website yourself.

The Google Admin SDK Email Settings API is not listed in the APIs Discovery Service

In working with the .NET client library we found that the Email Settings API was not available in it or any of the other client libraries. After communicating with the developers of the .NET library on how the library is generated we noticed that the Email Settings API is not listed in the API discovery service as part of the Admin SDK. The .NET client library relies on the discovery document as does the PHP client. Both the Directory API and the Reports API are.
I noticed that in the documentation for the Email Settings API that calls are still made to apps-apis.google.com:
https://apps-apis.google.com/a/feeds/emailsettings/2.0/
rather than to www.googleapis.com like the other Admin SDK APIs do:
https://www.googleapis.com/admin/directory/v1/
https://www.googleapis.com/groups/v1/groups/
https://www.googleapis.com/admin/reports/
I'm guessing that this is the underlying reason for why this particular API is not included. Is there a timetable for getting the Email Settings API moved to the googleapis service?
There are two types of Google APIs. Gdata APIs and discovery APIs.
The Gdata APIs are old APIs a lot of them have actually been shut down. The client libraries for them to my knowledge where not auto generated.
if you check the documentation for the email settings api there is some sample code for .net.
using Google.GData.Apps.GoogleMailSettings;
The key here is that its a Gdata, its a Gdata api. Which means that like you said its not supported by the current Google .net client library which only supports discovery APIs.
After doing some searching in the code for the Gdata client library. Yes it exists but it hasn't been developed on in ages. There is some code in there for Google email settings There should be a nuget package for it but I have not been able to find it.
The only thing that i have cound that might lead us to the corect nuget package is this
Install-Package Google.GData.Apps
I don't have an admin account so I cant help you test it. However I can probably give you some hints on getting it working. You should be able to track me down from my stack profile if you need help or just post another question on stack. I should spot it.

New Google Apps Marketplace Setup URL Domain Parameter

It seems like a lot has changed with the new Google Apps Marketplace. I'm trying to configure a setup URL for Google to redirect the user to in order to configure an application. When using a manifest in the past I was able to specify http://whatever.com/{domain}, {domain} being a dynamic piece of data. However, the new Google Apps Marketplace SDK does not use a manifest and gives an error when I try to include {domain} in the value. How can I achieve this? The documentation is very minimal.
For followup the standard is now ${DOMAIN_NAME}

Unable to google Google-API directory

I know its silly, but previously this URL used to show me all available google open source API's Pervious working API link but now its showing some other page. I am tired of searching the complete API directory. I want to pick one to learn. I have managed to find a similar page which shows only partial API's directory. Google API directory Can any one provide me the correct URL to see complete directory?
I must admit, it's a mess if you take a fresh start.
Accessing Google Apis can be basically be done in two ways.
The old way : Google Data Java Client Library (a.k.a. "gdata-java-client") : docs here. Implemented services can be found at Google Api Docs (the link you are referring to).
The new way : Google API Client Library for Java (a.k.a. "google-api-java-client") : docs here. The Api explorer shows the generated client libraries using the new infrastructure. Or this list.
Both libraries are available for different languages and for different Google services. GData is the most mature library and supports most services.
The new way however is more flexible : the client libraries and even the docs can be automatically generated for any Google service that is ready to transition to the new infrastructure. On the downside, not all Google services have a client library ready for the new infrastructure (e.g. Contacts).
You can access services that are not yet transitioned but you have to write your own XML model.
There is a migration guide to move from GData to new infrastructure.
try to find it on this page:
http://www.programmableweb.com/apis/directory/1?company=Google
or you can explore some apis here: (i don't know if thats all)
http://code.google.com/apis/explorer/
or just search what you need on:
http://developers.google.com

SDK for windows phone for Twitter API

I want to develop a sample App for Twitter on WindowsPhone7. So anybody suggest me if any SDK for Windows Phone is available. Also any code samples for the OAuth API implementation.
Thank you.
There a few tutorial about buliding Twitter app. An example. There are also a lot examples of Twitter apps in WPF or OpenSource projects like Witty which can be easly changed to SL for WP7.
Client-side OAuth manager DLL / Documentation:
http://cropperplugins.codeplex.com/releases/view/57233
You can view the source here:
http://cropperplugins.codeplex.com/SourceControl/changeset/view/66350#1710422
Doc here:
http://cheeso.members.winisp.net/OAuthManager1.1
It allows you to specify params like username, password, consumer key, secret key, and it generates the required HTTP headers for you.
See also, this discussion.

Resources