All Questions
Tagged with google-api-java-client java
579 questions
0
votes
1
answer
146
views
Java Google Mail API send "Precondition check failed" - 400 Bad Request for Service Account server-to-server no user
In response to Google's recent change to disallow username/password access to Google Workspace accounts from Google Cloud VM-instances, I am attempted to replace sendmail calls with Google API calls ...
1
vote
1
answer
129
views
Gmail Javi API batch too many requests
I am using the Java Gmail API to retrieve some email messages. Once I get a list of messages, I am using batching to get the individual messages info.
Sample code as follows:
List<MessageDto> ...
1
vote
1
answer
59
views
Search List returned multiple channels
I trying to send this request to get the channel
request = youtube.search().list("snippet");
request.setMaxResults(50);
request.setQ(channelName);
request.setType("channel");
we ...
1
vote
0
answers
59
views
I have a question regarding Google Calendar API logic
I'm testing Google Calendar authentication-related logic in Java. I'm not sure if I'm misunderstanding the concept, but I've been unable to resolve the issue for several days now.
My code is as ...
0
votes
1
answer
197
views
Google Drive credential returns 403 insufficientPermissions
I'm trying to get a list of files' data from Drive.
Following the google's example didn't work.
This is an example of my code:
private static final JsonFactory JSON_FACTORY = GsonFactory....
2
votes
2
answers
649
views
How can I set up a Google OAuth2 client using https scheme in Java using?
I am writing an application that uses the Spreadsheets API. Because I am using the write scope, which is sensitive, the OAuth2 redirect URI must use https instead of http (except when using localhost)....
0
votes
1
answer
2k
views
NoClassDefFoundError: com/google/auth/Credentials occuring after jar compilation, but not in dev environment
Background
I have built a mod for Minecraft, and I am now at the point where it is ready to be built into a jar and run it in the game. My IDE is Intellij, the framework I am using is Fabric, and I am ...
2
votes
1
answer
2k
views
google-calendar-api with java spring boot
I am developing a java Springboot web application. In Which I have multiple users that login with a adress mail and a password. The login is Ok.
@Override
protected void configure(HttpSecurity http) ...
0
votes
1
answer
75
views
Do I have to Google Sign everytime to upload a Video to Youtbe using Java?
public static Credential authorize(final NetHttpTransport httpTransport) throws IOException {
InputStream in = new FileInputStream(CLIENT_SECRETS);
GoogleClientSecrets clientSecrets =
...
1
vote
0
answers
996
views
GA4 Data API - How to set multiple dimensions and metrics
I am trying to generate a report using the Data API of GA4. However, I could not manage to add multiple metrics or dimensions to my report builder.
This is how I try to achieve this functionality:
...
1
vote
2
answers
771
views
API source error when changing to Google Analytics Ga4
I changed Google Analytics to Ga4
The administrator is pulling statistics through the api and using it.
API is using v4, so I think it's compatible with ga4.
Follow the manual to connect to Google ...
0
votes
1
answer
319
views
Google API Calendar calendar ID "primary" not working
I'm trying to integrate Google Calendar API and I've been able to configure the API using a Service Account with its ID and I've already shared my calendar with the new IAM email address that was ...
0
votes
1
answer
75
views
how to determine number of files in a folder in Grive or list them by date ascending
I'm using the Gdrive Java API and the code I have to list a directory is:
FileList result = driveService.files().list()
.setPageSize(100)
.setFields("nextPageToken, files(...
0
votes
1
answer
141
views
java.lang.IllegalStateException: getTransportChannel() called when needsExecutor() is true while getting gcp secret manager
I tried to use with dependency version google-cloud-secretmanager 2.13.0. is there anyone can help with this? Here is util class to get secret manager value.
public String get(String secretName) {
...
1
vote
0
answers
1k
views
Why am I getting an "unknown error" after signing in with Google OAuth 2.0 and Java
I am using the Java Client Library to handle Google authentication for my app. Below is the code to handle the authentiation. It is almost exactly the same as the code featured on the Java quickstart, ...
2
votes
2
answers
889
views
How to integrate Google Calendar client with GoogleCredentials in Java
Hi I am trying to use Google Calendar client with GoogleCredentials but not able to find any docs on how to make this work. Please add a doc or let me know how to make it work.
package com.example;
...
0
votes
0
answers
160
views
com.google.api.client.googleapis.json.GoogleJsonResponseException: 500 Internal Server Error in Files list using query search
I am trying to query a list of root files and folders which are owned by me and along with items which are shared with me.
So I am using this query - ((not 'me' in owners and sharedWithMe) or 'root' ...
1
vote
2
answers
1k
views
Error trying to create an instance of GoogleIdTokenVerifier using the Java Google Client Api
i'm trying to integrate the google login function on my website and i'm following the relative google doc for the server side token validation: https://developers.google.com/identity/gsi/web/guides/...
0
votes
1
answer
221
views
Getting 400 when uploading video with YouTube API
When trying to upload a video using YouTube Data API, I get:
Exception in thread "main" com.google.api.client.googleapis.json.GoogleJsonResponseException: 400 Bad Request
POST https://www....
0
votes
1
answer
181
views
How to insert text to tablecell google doc api with java client libary
i want insert text to table 2x3, when insert text with new rows i see strange behavior. How to calculate correct index to insert content in tablecell, or document for that?
List<Request> ...
1
vote
2
answers
453
views
Google cloud dataflow restapi always returns 403-SERVICE_DISABLED
I have this dependency
<dependency>
<groupId>com.google.apis</groupId>
<artifactId>google-api-services-dataflow</artifactId>
<version>v1b3-rev20221025-2....
1
vote
1
answer
1k
views
What is the data processing latency for the Google Analytics data api for (GA4)?
I am reading the analytics data using API call found in this link
Google Analytics Data API (GA4)
What is the google delay to return all the info? for example, at 5 Am can I be sure I am receiving ...
1
vote
1
answer
277
views
Create a job on jobs google via api returns "The Application Default Credentials are not available" [closed]
I started to create an application for posting vacancies in jobs.google. I can not find an open api in order to post these vacancies directly on jobs.google through it.
Tell me how to do it.
I found a ...
1
vote
0
answers
202
views
How to check if we have more pages in GA4 using JAVA
I am reading the GA4 info according to the code sample provided here in Google Developers Documentation.
I do not know how to check if there are more pages? looking at the result's size I guess I am ...
0
votes
1
answer
189
views
Updating meeting recipient calendar through service account
Can my app update google calendar recipient meeting, if the recipient has given access to the service account of the App? When I try to do that, I get this message:
Exception thrown: 403 Forbidden
...
0
votes
1
answer
857
views
Google authorization as a Service Account (Java)
I'm trying to get authorization through a Service Account to Google Sheets (No confirmation window). I can't find any information about it. If I use the method from https://developers.google.com/...
6
votes
0
answers
1k
views
Google Drive APIs returns 500 - Internal error when page size exceeds 150
I am using Google Drive's java Client Library to list and download files from my application. When trying to list files, I am getting 500 Internal Server error from Google.
{ "code" : 500, &...
0
votes
1
answer
176
views
Handling DST in google api using java
I need to create some events and upload them to a google calendar. Now I have hit an unforeseen bump, as the times and timezone offset gets changed automatically, once uploaded. I am working with a ...
1
vote
1
answer
873
views
When my application is trying to access Google Drive API, I am getting com.google.api.client.auth.oauth2.TokenResponseException: 400 Bad Request
This my application worked successfully before. The issues appeared despite I did not change any application code. Neither I did any changes in the drive api console.
Currently it is being ...
7
votes
3
answers
4k
views
Compatibility problems when using 2.0.0 google-api-client for Gmail calls
I've been working on a little project that connects to the user's Gmail inbox and reads the mails using google-api-client 2.0.0 and google-api-services-gmail version v1-rev20220404-2.0.0
When I try to ...
-1
votes
1
answer
788
views
The Application Default Credentials are not available. They are available if running in Google Compute Engine. Otherwise - java android
I making an app using google drive to store files for user to their google drive
I followed google developer guide in https://developers.google.com/drive/api/guides/about-sdk
and when i press the ...
1
vote
2
answers
455
views
Reading labels works but reading messages results in ACCESS_TOKEN_SCOPE_INSUFFICIENT
I have created one poc using Gmail API which read all email and print on console. I have take refrence from Gmail api Java quickstart.
I have follows all the steps like create project, Gmail API ...
1
vote
1
answer
3k
views
Gmail Send request results in "insufficient authentication scopes" error
I try to send mail use Gmail API. My code almost the same like in google tutorial, but when I invoice this send Message method I get error Request had insufficient authentication scopes.
This is full ...
3
votes
1
answer
3k
views
Spring Boot: No converter for [class java.io.ByteArrayOutputStream]
I'm trying to export a document from Google Drive via their Drive API, and there's an example of it in the docs, but I didn't have any luck with it.
Here's my code:
@RequestMapping(value = "/test&...
0
votes
1
answer
418
views
Unable to upload file in specific folder in google drive using REST API
I am trying to upload a local file to a specified folder in Google Drive using REST API from android app, the file is uploading in the root directory but not uploading in the specified folder. No ...
3
votes
1
answer
3k
views
Sending email via Google API - Failed precondition
I'm trying to use my Google Workspace account to send emails in my Spring Boot application.
I went to the Google Cloud Console and I:
Created a new project and selected it (namely ...
1
vote
1
answer
1k
views
Java: Mock Google Api Client Library's HttpResponse
Suffered a lot in finding how to mock http response . Mocking http request for the same library was easy . Thought to create a thread here , to save your time should you need it .
Requirement ->
...
1
vote
1
answer
716
views
Error getting access token for service account: 401 Unauthorized\nPOST https://oauth2.googleapis.com/token; Google Calendar API
I have integrated Google Calendar with business email of my company. Everything works fine if we use email with our own domain. However, if a certain user uses with a simple gmail.com domain the error ...
0
votes
1
answer
2k
views
How to Get User Profile details by using accesstoken (tokenId)?
I tried to get the profile details of the google user, I already got an access token by using the refresh token now I want to get the details of the user.
I have no idea what I have to pass in the ...
0
votes
1
answer
2k
views
Migrate to GoogleCredentials from GoogleCredential
Currently, I am using the following implementation but the code says GoogleCredential is deprecated.
GoogleCredential credential = new GoogleCredential.Builder()
.setClientSecrets(...
0
votes
1
answer
873
views
How to get GID of one Google Sheet when given the url to another tab of that Sheet
By default, when you open a Google Sheet without any GID parameter in the URL, it will open to the first tab. I want to open to a specific tab which has a consistent tab name.
I have the url of a ...
1
vote
1
answer
1k
views
GMail API Server to Server Authentication
i am trying to implement a task by which to access GMail through the Google API (Java client). The scope of the task is that it will retrieve a user's emails, labels etc. It's my first time ...
0
votes
0
answers
85
views
Cannot access files under resource directory in a jar
Basically working on a spring project that is trying to leverage google api. To do so I need to access the StoredCredentials file, which is follows this path:
src/main/resources/[email protected]/drive-...
0
votes
0
answers
354
views
Groovy script to get translations using Google Translate API gives java.lang.NoSuchMethodError
I am trying to write a Groovy script to get translations from Google Translate API (using an API key, stored in as the GOOGLE_API_KEY environment variable1) but I get an error I'm not able to overcome....
10
votes
3
answers
10k
views
Version compatibility between google-api-client and google-api-services
There is a project which depends on google-api-client and google-api-services-drive.
google-api-client verion looks like this: 1.23.0, and there is a changelog on github for this library.
google-api-...
1
vote
1
answer
410
views
Gmail Oauth2 Access with intranet web server
Does anyone know the correct setup for the cloud project and redirect URL within the application for the following case?
Setup:
Spring + Apache Wicket
The application is installed on a server (...
0
votes
2
answers
385
views
Google Drive setup push notifications
We want to receive notifications from google when we do anychange(Add,Edit OR Delete) on google drive folder for these purpose we have integrated google watch api in our spring boot application.
code ...
2
votes
1
answer
2k
views
java google drive API unable to download binary file
I have working code to list the files in my Google Drive folder containing binary files but I'm getting an error when trying to download:
GET https://www.googleapis.com/download/drive/v3/files/...
0
votes
1
answer
2k
views
Perform Multipart upload in GCS in JAVA
I have a file of more than 1GB and want to upload it to Google cloud storage in chunks by using the client library for JAVA. I was able to find multipart upload functions in AWS as well as for ...
1
vote
1
answer
1k
views
Google speech to text with java and twilio
I am having problem while converting audio file to text using google speech to text. I am able to download the file from Twilio but when I supply that audio file to google speech then it gives me 0 ...