Google Calendar API: calendar.events.freebusy vs calendar.freebusy - google-calendar-api

I have seen the description provided for these scopes in the console, but they are not clear for me.
What is the difference between these two scopes?

OAuth 2.0 Scopes for Google APIs
Calendar API:
It would be important to clarify that all necessary scopes for any Google application can be found here:
https://developers.google.com/identity/protocols/oauth2/scopes
There are 5 scopes over the official documentation that allows you acess Calendar and their properties, plus another 2 that are used for managing Calendar Resources from Google Admin for organizations. This means that both of those are old and deprecated scopes (Potentially from V2 or were removed due to being no longer necessary and packed under any other ones from the documentation):
https://www.googleapis.com/auth/calendar.event.freebusy
https://www.googleapis.com/auth/calendar.freebusy
If you try to run or access any of these scopes you would be prompted with an alert similar to this:
As one final thing that can easily help you with deatils on what scopes are needed to query Freebusy information, you can review the authorization scopes needed to run it here:
https://developers.google.com/calendar/api/v3/reference/freebusy/query

Related

Google analytics API - how to create new account

Okay, some heads-ups as I feel I'm an idiot and missing some simple stuff. As far as I understand Google Analytics works with a 3 tiers system: account -> property -> view. and I should be able to manage these 3 levels via the google analytics management api.
For some context as to why I encounter this issue. I am making a CMS in which I want to register a new google analytics account per user, and a property per website this user has. (implementation and usage of views out of scope for now, I will implement those on a later date). To achieve all of this I started following Google's documentation on the Google Analytics Management API (according to Google this is what manages accounts, properties and views). Therefor I have made a service-user-account which should have enough permissions to manage GA-accounts.
However I can't seem to be able to create a new account via the API. Am I missing something obvious? Is it not possible at all this way? If so, how then? Because my goal is to have GA on every website, without the user having to config anything.
You can't do it. The management API only allows for the list operation on accounts: https://developers.google.com/analytics/devguides/config/mgmt/v3/account-management#account_summaries
The only solution would be to use the Provisioning API. It can be used to create new Google Analytics accounts and enable Google Analytics for your customers at scale: https://developers.google.com/analytics/devguides/config/provisioning/v3/
Anyway, the Provisioning API is currently available by invitation only.

Development and Testing - Organizations APIs - LinkedIn API

LinkedIn provides 2 public organization API for development purpose:
link
But when I try to access these organization using:
link
It is showing following API fail message:
{"serviceErrorCode":100,"message":"Not enough permissions to access: GET-organization /organizationPageStatistics","status":403}
Is there any problem with my current flow?
From the docs here: https://learn.microsoft.com/en-us/linkedin/marketing/integrations/community-management/organizations/page-statistics#parameters it looks like the organization id is formatted differently
https://api.linkedin.com/v2/organizationPageStatistics?q=organization&organization=urn:li:organization:6177438
Edit: Also, auth tokens are not spec'd to be used as query parameters. You're meant to follow these steps: https://learn.microsoft.com/en-us/linkedin/shared/authentication/authorization-code-flow?context=linkedin/marketing/context and then use the token in the request header.

Is it possible to create Service account and get p12 key programmatically for google accounts?

I need to extract Google Analytics data through it's API. However I do not want to generate any account and key manually (the reason is I do not want to let this technical this to be performed by any non-techie person) and want to dump that data for analysis purpose.
In order to use any of Googles APIs they need to know who you are. You as a developer are identified by the project you create on Google Developer console. Once the project is created you can create a number of different types of credentials including Service account credentials and Oauth2 Credentials.
Answer: No there is no way to programmaticlly create service account credentials. Nor is it possible to use the a Google api without first creating a project on Google developer console.
Note: Google Cloud Resource Manager does exist but is very limited in what it allows you to do.
If someone else is going to be running your application to access their Google analytics Data you should idealy be using Oauth2 in your application and not a service account.
Service accounts are designed as way for the developer to grant others access to data owned by the developer in question. They are not really intended for novice users to be creating their own projects on google developer console and generating credentials.
You are basically asking if you can obtain the credentials necessary to query the API via the API. This does not work.
I am also not sure how this would help you. Before you can do any API operations to a Google Analytics account you need to have an authorized user (e.g. a service account) added to your view or property. If you are in a situation where you can add a user programmatically to an account you might as well just read the data you need.

How to read a public Google calendar from a mobile app without authenticating?

I need to read many Google public calendars from an iOS app. I don't want to require users to authenticate.
The docs and samples from Google all seem to assume an app is reading a user's private calendar, which naturally would require authentication.
I see something called a Service Account mentioned, but it's not obvious that it should be used in mobile apps.
I don't need to use one of the SDKs if I can just retrieve JSON from some URL.
This question has been asked on StackOverflow in the past, but I haven't found an answer which still works. Google changed their API in 2014.
How can I read a public calendar from a mobile app without authenticating?
The answer was given in the comments by #Mr.Rebot and #Vipin Sharma. Just use this URL:
GET https://www.googleapis.com/calendar/v3/calendars/{YOUR_CALENDARID}/events?key={Y‌​OUR_API_KEY}
One can get an API_KEY from the Google developer console. It's an option I overlooked at first.

LinkedIn New API - Can't Get r_network Permission

I inherited a program that was written with the old LinkedIn API, and I'm trying to migrate it to the new API. When I try to get the r_basicprofile permission, my oauth token works. However, when I try r_network or rw_nus, I get a response
invalid scope -- your application has not been authorized for
r_network.
Yet, when I go to www.linkedin.com/developer/apps/xxxx/auth, the boxes for r_network and rw_nus are checked.
I.e., A request to
https://www.linkedin.com/uas/oauth2/authorization?response_type=code&client_id=xxxxxx&scope=r_basicprofile&state=yyyy&redirect_uri=http%3A%2F%2Fkalatublog.com%2Fwp-content%2Fmu-plugins%2Fimb-en%2Fhelpers%2Fsocial-connect%2Fapi%2Ffinalize.php%3Fapi%3Dlinkedin%26ch%zzzzz
works, but a request to
https://www.linkedin.com/uas/oauth2/authorization?response_type=code&client_id=xxxxxx&scope=r_network&state=yyyy&redirect_uri=http%3A%2F%2Fkalatublog.com%2Fwp-content%2Fmu-plugins%2Fimb-en%2Fhelpers%2Fsocial-connect%2Fapi%2Ffinalize.php%3Fapi%3Dlinkedin%26ch%zzzzz
gives that error. What am I doing wrong?
As of May 15,
After the grace period expires, several REST API endpoints will no longer be available for general use. The following endpoints are the only ones that will remain available for use:
Profile API — /v1/people/~ `
Share API — /v1/people/~/shares
Companies API — /v1/companies/{id}
If your application is currently using any other API services (e.g. Connections, Groups, People Search, Invitation, Job Search, etc.) you will have to apply to become a member of a relevant Partner Program that provides the necessary API access to continue to leverage any of the endpoints that are not listed above.
It looks like linkedin no longer wants to share anything with their API. Creating a new app indicates that the only possible options are r_basicprofile, r_emailaddress, rw_company_admin, and w_share:
TLDR: they have locked down the API and restricted the usage to an extremely limited set of access points.
I did some more digging. The linkedin website is misleading. On my app linkedin page, it says that I'm approved for rw_nus and r_network, but on this page
https://developer.linkedin.com/support/developer-program-transition
it says those are no longer approved.
So the app home page in linkedin incorrectly said I had those permissions.
Heres the link if you want to Apply for Linkedin
https://help.linkedin.com/app/ask/path/api-dvr

Resources