I want to access to the calendar to read/create event from the user if he agrees.
I've followed the guide https://developers.google.com/google-apps/calendar/v3/sync
I've actived the api with my google account. Then use the OAuth 2.0 to get a code and the token.
When I follow the test, I use another account to simulate a random user.
Arrived at the lecture of the agenda, I get this error:
Error calling GET https://www.googleapis.com/calendar/v3/calendars/primary/events?maxResults=10&orderBy=startTime&singleEvents=true&timeMin=2016-06-14T11%3A28%3A25%2B02%3A00: (403) Access Not Configured. Calendar API has not been used in project 1056... before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/calendar/overview?project=1056... then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.
It seems legit but I don't want the user to active the api on his side...
What am I missing?
Go to Google Developers console and enable the Google Calendar API. You need to tell Google which APIs your application will be accessing.
Related
I am building a wordpress woocommerce site and am trying to get the users to login using G+.
Everything was going just fine till I changed the plugin I was using and added new redirect URLs to the OAUTH 2.0 Client ID.
Now the users get the error:
Access Not Configured. Google+ API has not been used in project
1033299751186 before or it is disabled. Enable it by visiting
https://console.developers.google.com/apis/api/plus/overview?project=1033299751186
then retry. If you enabled this API recently, wait a few minutes for
the action to propagate to our systems and retry. Please notify about
this error to the Site Admin.
Any help would be appreciated.
Thanks
You need to go to google developer console as it says under the project 1033299751186 and enable the Google+ api.
Your project needs to have each of the different APIs enabled that it needs to access.
Look for API manager -> Enable APIs (its a tab at the top)
I am trying to get youtube video views by date range and it is working fine with oAuth. But I am using cron script to collect those data through service account, when I try to execute the script it says:
Error calling GET https://www.googleapis.com/youtube/analytics/v1/reports?ids=channel%3D%3DUC88Bq63MDJi9szYPEGfv7YA&start-date=2014-02-01&end-date=2016-06-29&metrics=views:
(400) Invalid query. Query did not conform to the expectations".
Could you please help me anyone to resolve this issue. Thanks in advance.
Using service account is not supported by Youtube Analytics and Reporting API
The service account flow supports server-to-server interactions that do not access user information. However, the YouTube Reporting API and YouTube Analytics API do not support this flow. Since there is no way to link a Service Account to a YouTube account, attempts to authorize requests with this flow will generate an error.
Unfortunately, you need to do OAuth2 to get your report.
Resources you can check for information:
Youtube Analytics API PHP Invalid query. Query did not conform to the expectations
Implement OAuth 2.0 Authorization
I need to access a NON-public Google calendar WITHOUT requiring the user to log in or even have a Google account.
I created an Android app that accesses a Google calendar using a service account:
GoogleCredential credential = new GoogleCredential.Builder()
.setTransport(httpTransport)
.setJsonFactory(jsonFactory)
.setServiceAccountId(serviceAccountID)
.setServiceAccountScopes(scopes)
.setServiceAccountPrivateKeyFromP12File(licenseFile)
.build();
com.google.api.services.calendar.Calendar.Builder builder = new com.google.api.services.calendar.Calendar.Builder(httpTransport, jsonFactory, credential);
builder.setApplicationName(appName);
com.google.api.services.calendar.Calendar client = builder.build();
com.google.api.services.calendar.Calendar.Events.List list = client.events().list(calendarID);
list.setMaxAttendees(maxAttendees);
list.setTimeZone(timeZone);
list.setTimeMin(startTime);
list.setTimeMax(endTime);
list.setOrderBy(orderBy);
list.setShowDeleted(showDeleted);
list.setSingleEvents(true);
Events events = list.execute();
This included:
Creating a project in the Google App console
Creating a Service Account
Giving the Service Account access rights to the Google calendar
It works GREAT!
I need to do the same thing in IOS. I have read every question/answer I can find on this topic and have found VERY different answers. Many say that Google hasn't allowed this in the IOS SDK because service accounts are intended to be used by server-based applications. I don't agree since the functionality I need is available in Android. So, now what?
The use case is this:
My IOS app needs to access a Google calendar. That part is not too tough if you are okay with using OAuth. My problems with this approach are:
Requires to user to have a Google account. Many of my users are Apple-Only. I can't require them to get a Google account just to use my app.
I can't make the calendar public. So, I would need to give access to every new user. I guess I could do that with a web-based application but this doesn't fix the problem (refer to previous problem - no Google account).
I really need to be able to query the events in the NON-public Google Calendar WITHOUT the user needing a Google account. The solution IS using a "Service Account" (I think).
I read one question/answer that said this is possible but the solution was never posted. (How to list Google Calendar Events without User Authentication)
HELP!!!!
The official documentation suggests that if you want to handle Calendar API (for example), you'll have to have a Google Apps for Work (source).
If you have a Google Apps domain—if you use Google Apps for Work, for example—an administrator of the Google Apps domain can authorize an application to access user data on behalf of users in the Google Apps domain. For example, an application that uses the Google Calendar API to add events to the calendars of all users in a Google Apps domain would use a service account to access the Google Calendar API on behalf of users.
Once the prerequisite is met, you can try to just call the REST URLs of Calendar API based on your implementation (since there seems to be no iOS support or samples available in the documentation).
I have been struggled with Youtube API and now I am stuck.
What I did is:
create a project at google developers console(https://console.developers.google.com)
enabled "YouTube Data API v3"
generate api key of iOS.
access to https://www.googleapis.com/youtube/v3/search?key={API KEY}&part=id&q=soccer by web browser and got the error message
Am I missing something?
I have read many questions but I cannot solved yet.
In step 3 "generate API key for IOS", the comment on the Google Developer Console web page says
Use of this key does not require any user action or consent, does not grant access
to any account information, and is not used for authorization.
Clicking on the *Learn More" button, it says:
Use an API key when your application is running on a server and accessing one of the following kinds of data:
•Data that the data owner has identified as public, such as a public calendar or blog.
•Data that is owned by a Google service such as Google Maps or Google Translate. (Access limitations may apply.)
I think you need to use the OAuth process rather than the API Key. Click on Learn More in the OAuth section of the Developer Console web page to learn about using OAuth with Apple iOS.
To create oAuth credentials for iOS:
Create new Client ID / Installed Application / iOS
I know it sounds a bit elementary, but I solved this same problem by going back into Google developer, creating a whole new project, new API key, and then it worked. Google quirk??
I coded a desktop calendar application a while ago, based on an existing database for an older calendar.
A bit later I added functionality to interact with google calenders using the v2 api, that is deprecated for a while now. Functionality might brake in november: Deprecation Policy ..so I thought it's about time to update to the v3 api.
What my calendar application does related to google calendar:
Writing/Reading in a shared google calendar
Writing/Reading in own (multiple) private google calendars
Syncing private/shared google calendars into an own database.
In v2 it was pretty easy to login to any calendar having the credentials with the GoogleDataApi
CalendarService calService = new CalendarService("MyCalendar");
calService.setUserCredentials(account, password);
and then reading, writing, update events.
In the v3 api theres no clientlogin anymore, how would I proceed with oauth2 to achieve the same functionality? How would I let a user login from my desktop application to his google calendars, so he is able to sync/view/edit/add google events?
Updating is a good idea! For v3 you should take a look at Oauth2 for desktop app (you will need to get and store Oauth2 access token and a refresh token for your users to not need the user to re-enter their credentials). The calendar documentation for this: https://developers.google.com/google-apps/calendar/auth
The generic Oauth2 documentation: https://developers.google.com/accounts/docs/OAuth2InstalledApp
Some more documentation from drive: https://developers.google.com/drive/web/about-auth
And the most useful of all, the playground to try stuff out: https://developers.google.com/oauthplayground/