Google Analytics API - how do I get access tokens without being an Admin - google-analytics-api

I'm very new to using APIs and I'm struggling to figure out the authentication. With my email I can log in to a corporate analytics page and view the information. My account is only at a 'user' level. How do I get access tokens so I can scrape the data from the page using the Google API? Do I need the admins of the page to get these tokens? I tried using the generate access token but I don't know the service account email. Any advice would be appreciated because I'm so confused.

Answer: how do I get access tokens without being an Admin
As long as your personal account has read access you can use Oauht2 to authorize your application and then be able to access the data that way you do not need to be admin.
All your other questions 😊
How do I get access tokens so I can scrape the data from the page using the Google API?
First off if you use Oauth2 in your application and login with your own user you you will be able to use the Google Analytics api as you have read access thats all you need for the Google analytics api in order to request data.
Do I need the admins of the page to get these tokens?
No anyone with read access can authorize an application to access the google analytics api.
I tried using the generate access token but I don't know the service account email.
Service accounts are completely different than normal Oauth2. A service account is a dummy user which needs to be preauthorized to access the data it has nothing to do with your personal access. To preauthorize a service account to access the google analytics api you will need to have admin access to the google analytics account and take the service ac count email address and add it as a user on the google analytics account. It will then have access to read the data.
Any advice would be appreciated because I'm so confused.
Decide if your application should be allowing users to login to it and access the data on their own google analytics accounts. If so then you should be using Oauth2 and not a service account.
If you are only trying to access this single google analytics account then you should be using a service account. However you will need to contact the admin to have them grant your service account access to the data.

Related

How can I Get AWS Cognito id token From Google Login?

I looked it up for a month but couldn't find it. Unity and Google login links, Google and aws cognito links, and cognito and unity links exist, respectively, but I have not found a way to handle them at once.
I could follow this Document and get AWS Credentials. However, it only provides access tokens for authorization, not ID token for authentication.
So, How can I Get AWS Cognito id token From Google Login?
I don't want to use the hosting UI provided by this post. I learned how to get an ID token from a post, but I want to know how to find it without opening an external browser in the app.

FB Ads Insights API : get the access token using credentials

I am new to FB's API
I need to use FB Ads Insights API to pull the stats and store in DB. This is my customer's requirement. Now, I have a Developer account and access to my customer's username and pwd, how can I use their credentials and get the access token to query Insights API
TIA,
Use this guide to generate an access token. You will have to create a system user that has access to your customer's account.

Google Analytics Embed API

I am working on embedding of our google analytics dashboard in our web portal using its API, after walking through this example, Embed API - Getting Started
I am facing a problem; that when I logged in to google analytics account and run this example, it is fetching the results, but when there is no logged in session, it returns
Object { errors=1, code=403, message="User does not have any
Google Analytics account."}
retrieved from browsers developer tools... I have added the service account email address to Analytics Admin Console as well. please suggest the solution
You need to have a session logged in with access to the account.
Check the Google Account you are logging in with it needs to be one that has access to the Google Analytics account that you want to check. The Google account you are authenticating with currently doesn't have access to any Google Analytics Accounts.
Service account wont work with embedded API you need to use Oauth2.

Difference between Authenticating user into my website using gmail account and googleplus account

I am developing a website, where users will can login using their Google account. When i was about to develop this feature i came to know about two things
Gmail api
Google+ api(social)
I want to know want is the difference between these two apis, why google is providing two different apis for authentication. I tried using google+ api, and if the user doesn't have an account in Google+ then google is forcing user to register into google plus and then login to my website.
Which one is better to use for authentication into our website google or google+?
If you will use Google plus Api for authentication process then user need to have google plus account and If user is not having google plus account then He need to create it
I suggest you to use Google api for authentication because you can get basic information with it but if you want to get all social media data of google plus then you have to use google Api
Simple - API calls do not access any private user data
Authorized - API calls can read and write private user data, or the applications own data - API key plus OAuth 2.0 credentials (different for different application types)

How can I use a service account to authenticate with Azure AD using OAuth2.0

I'm developing a Web API that needs create, read, update and delete privileges on OneDrive for Business sites using REST.
So far my understanding is that an Azure Application will need to be registered within Azure for this
WebAPI.
Once registered the Application will have a client ID and secret key that can be used as part of OAuth. Also within Azure it can also be given the permission to call the SharePoint 365 API. (Provided the authenticated user is also authorized).
MSDN has code examples in which using the Application client ID within OAuth the client gets redirected to a login page for authentication. Once they enter in their username and password they are redirected back to the web application.
http://msdn.microsoft.com/en-us/library/azure/dn646737.aspx
As I am developing a web API I do not want any redirects to login pages. Instead I would like to automatically authenticate using a service account. (Which will have appropriate permissions within the OneDrive for Business site).
Does anyone know how this can be done or point me in the direction of some code samples?
Thanks
Service to Service (app only) grants aren't possible today for SharePoint with AzureAD OAuth. We only allow app + user grants.
This is on our radar - please stay tuned.