How to authorize google analytics API through API Key - api

I need to display the analytics of my site to all the users, but Using OAuth it displays the analytics of the sites configured for the logged in user. How can I implement a dashboard using embed API but showing my website analytics only?
The best possibility I can come up at is using API Key instead of Client ID, but I am unable to find a way to do it.
Does anyone have anything else in mind.

API keys are used for accessing public data, like the list of dimensions and metrics in the metadata API. In order to access private Google Analytics data you must use Oauth2.
So you don't want to use the API key, what you want to do is use a service account and then authorize the service account service-side, receive and access token from that authorization flow, and then pass that access token to the Embed API.
Here's a full working example:
https://ga-dev-tools.appspot.com/embed-api/server-side-authorization/

Related

Authenticating users from separate devices to be be able to pull data from an API

I'm having trouble deciding on / understanding which method of authentication would be best in the following situation:
I have 3 separate "clients". A website, mobile app and browser extension.
Users information and data is stored in a database.
The 3 clients will access the data via an API.
What I am trying to get my head around is how users of the system would login via one of the three clients and authenticate with the API so they can then proceed to get and post data to the API.
I do not require 3rd party applications to access the API. Users can only access it by logging into the clients I provide. For this reason am I right in thinking that OAuth1/2 would be over kill?
I have attached an image which details how I envision the system.
An additional question:
Where is it in the system the authentication comes in? Would I authenticate within the API? So the user uses a form on one of the three clients to send a password. The API then returns a "what" if they provide valid credentials?

How can I access public API Information without Login?

I'm trying to access public information from API's without actually having users grant access to the API in my mobile Application. Is this actually possible, or are the Oauth permissions for any sort of access to an API?
For example, I want my application to be able to pull a list of nearby restaurants for my application without asking the user if Yelp can access the application. Since the user just wants nearby food information, the request for restaurants isn't user specific, and the user shouldn't actually have to login.
Another example is if I want Eventbrite to simply give me a list of upcoming events. Is there a way to get this list without having a user authenticate Eventbrite within my application itsself?
You can call an API endpoint with your own token (between your Eventbrite account and your application key), and if the data is public (even if it's 'owned' by a different Eventbrite account) we'll return the data.
For example, if you want a list of events across our Event Directory (Event Search endpoint: http://developer.eventbrite.com/docs/event-search/) you can call this method with your own OAuth token (you can grab your OAuth token here: http://eventbrite.com/myaccount/apps).
Hope that helps!

Create Google Plus Events via API

Is there a possibility to create events for Google Plus Communities via an API?
The only related post I could find is this one: Is there an API for the Google Plus Events but it only considers requesting events.
No, the G+ API is currently read-only.
Note: The Google+ API currently provides read-only access to public data. All API calls require either an OAuth 2.0 token or an API key.
Cheers

Get all the information on the website through LinkedIn API

I'm working on an app for LinkedIn. I want to access all the information available on the website but the API doesn't return most of them. I was wondering how to get them.
I can use screen scraping but I wonder why the API doesn't return the information when I can easily access it on the website?
For instance this profile has many education information and it's public but none is returned via the API!!!
The LinkedIn API is purposely designed to return certain datasets, some that are only accessible via the website and not the API.
Also, scraping any part of LinkedIn's website or its content is in violation of the LinkedIn API Terms of Use: https://developer.linkedin.com/documents/linkedin-apis-terms-use

Accessing linkedin api without repetitive sign in?

I am new to linkedin api. I have a doubt regarding the api.
I am integrating the api in my application, so different user have to register in the linkedin to get the data using that api? Can it be pre registered and the user can get the data whatever he wants.
Suppose user wants to search about company. He will type the company name and will get the names of the company related to search. He should not log in in linked in before searching.
Is it possible?
If you are using the JavaScript API, then yes, you may need to have the user log in each time as the JavaScript API's authorization is cleared every time the user closes their browser.
If you are using the REST API, you can store the user's OAuth token and use that to make the calls on behalf of the user, saving them having to sign-in each time.