Questions tagged [google-api-java-client]
The Google APIs Client Library for Java is a flexible, efficient, and powerful Java client library for accessing any HTTP-based API on the web, not just Google APIs.
1,093
questions
0
votes
0
answers
32
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....
1
vote
0
answers
43
views
How can I use my retrieved access_token with the Googles Credential Builder instead of a service account
I am using the Google Drive API V2 with the Java Library in ColdFusion. It is from this project (which is old) https://github.com/PCommons/cf-google-drive.
The code is written to work with a service ...
1
vote
1
answer
60
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
58
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 ...
1
vote
1
answer
103
views
Credentials in GoogleCalendar API with service account (Java)
Right now I need to implement an app to create some google-calendar events but for a service account. I saw examples in docs that create events using AuthorizationCodeInstalledApp (or similar) to ...
1
vote
1
answer
158
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
67
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
166
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 ...
2
votes
2
answers
68
views
Google Meet Conference setup through Google Calendar API - Java/Kotlin
I have integrated Google Calendar API and able to create meetings properly. Since google also allows for creation of Google Meet conferences through Google Calendar API - I have been trying to access ...
0
votes
0
answers
8
views
How to debug connection to google drive from Android using service account [duplicate]
Note this question was closed because it was considered that
this post addressed the same issue and solved the problem, which is not the case.
The information in that link deals with a very different ...
1
vote
0
answers
29
views
Class not found "Java.time.Duration"
I am getting following exception On Fire OS 6 and it works on Fire OS 7.2(Android 9) and Java library for OAuth 1.0a and OAuth 2.0 support Android 4.0 and higher. Why it is not working on Fire OS 6 ...
1
vote
1
answer
129
views
Connection Reset error with Google Drive APIs
I am using a Google Service account to create Google Drive resources.
However when i try to execute Drive create folder API i get connection reset error.
I can confirm that the credentials for the ...
1
vote
0
answers
48
views
Stopped reading google tables (invalid stream header: EFBFBDEF)
My integration with Google tables worked successfully for half a year, but today it stopped because of an error
java.io.StreamCorruptedException: invalid stream header: EFBFBDEF
has anyone encountered ...
4
votes
2
answers
239
views
How do I open GoogleSheets Service with a Stored Refresh Token using Java API v4
I am working on an application (Apache Drill) and looking to build a connector to Google Sheets using the Google's Java API (v4).
I have this working, however, I would like to store the refresh token ...
0
votes
1
answer
63
views
google.visualization.Query does not seem to work on my code anymore
I am dusting off an old html page I have not used in a few years that pulls data from google sheets. I had a bunch of them that worked just fine a few year but are not working anymore.
This is the ...
1
vote
0
answers
40
views
How do I open a Google Sheets Service using StoredCredentials?
I am working on an application (in Java) which will pull data from GoogleSheets. I am looking to retain the credentials in using Google's StoredCredentials object, however while I have figured out how ...
0
votes
0
answers
175
views
is it possible to do Google calendar API event invite to random gmail guests from my service account?
I am writing an angular spring boot application where my requirement is to set up a meeting between 2 users of my application. I have a service account and I have followed the domain-wide delegation ...
0
votes
0
answers
54
views
Pragmatically transfer google drive folder and files across domain
Is there a way to transfer ownership of files on the drive owned by x@gmail.com to the drive owned by y@test.myschool.com - using google dive Java API? I own x@gmail.com but have no control over test....
1
vote
1
answer
207
views
Can't transfer ownership of google drive txt files using gmail account and java API
I am developing a multi user java web application which lets users list/share their google drive files between gmail accounts. I utilize oauth2 authorization code flow where user accessing my app, ...
1
vote
1
answer
132
views
Transfer google drive file ownership using google java api
I have uploaded some test files to my google drive using their website and my gmail account (x@gmail.com). The files are in "My Drive" and not shared drive. I am then trying to write a ...
1
vote
2
answers
715
views
class Google.Apis.Auth.OAuth2.GoogleCredential.UnderlyingCredential.GetAccessTokenForRequestAsync() equivalent in Java?
I have built an Azure Function App in C# & I am trying to figure out the equivalent of Google.Apis.Auth.OAuth2.GoogleCredential.UnderlyingCredential.GetAccessTokenForRequestAsync() in Java, as my ...
1
vote
1
answer
151
views
Locally works, fails on server : Google calendar API
In an existing Java based spring boot application, I have integrated Google calendar API. In my local, it works. On dev server, I see that the URL to open in browser is :
https://accounts.google.com/o/...
0
votes
0
answers
98
views
Could not initialize class org.powermock.modules.junit4.rule.PowerMockRule while running test case in cloud shell
I'm getting the following error when I run my test cases in cloud shell environment of gcp
Tests in error:
testMain(org.##.addg.gcp.##)
testRunWithEmptyConfig(org.##.addg.gcp.##): Could not ...
1
vote
1
answer
947
views
java.lang.IllegalStateException: getTransportChannel() called when needsExecutor() is true while using bigquery client library in dataflow
Due to some criteria I need to write some entries to a specific table using bigquery client library in my dataflow job, I can query a table using bq client library without any issue but when I try to ...
0
votes
2
answers
138
views
Google Bigquery java client listTables return numBytes and numRows as null
When I try to find the size of all the tables using listTables API of BigQuery java client, it returns null. But if I use getTable individually, I get the proper data. Is this a known issue, or am I ...
2
votes
1
answer
421
views
"Please open the following address in your browser..." issue with google sheets api and spring boot
I want to add functionality for reading google sheet in my spring boot project. I have followed guides from https://www.baeldung.com/google-sheets-java-client and https://developers.google.com/sheets/...
0
votes
1
answer
488
views
Google drive API (v2) unable to download few files (with extension xlsx,pdf)
I am trying to download documents/files store in google drive using google drive API version (V2). though I am able to download files successfully except few that are failing with Bad request.
I have ...
0
votes
1
answer
425
views
How to publish messages to Cloud Pub/Sub via the JAVA Client using a dependency?
I have written the following method inside a maven package:
public static void publishMessage(Publisher publisher, String message) throws ExecutionException, InterruptedException, TimeoutException {
...
0
votes
0
answers
62
views
Spring Boot Google Drive API missing: response_type [duplicate]
I am trying to upload a file into Google Drive. I did everything what they suggest on this website https://developers.google.com/drive/api/v3/quickstart/java . But eventually when my @Scheduled method ...
1
vote
2
answers
130
views
How to create a Google calendar event for non-workspace-google account, if the event was created through Service Account(Google Calendar API)?
I am able to create an event in Google Calendar using Service account and Google Calendar API, where Project and Service Account is created in Google Workspace admin account and in the same account, I ...
5
votes
1
answer
402
views
How to initialise Google drive using GoogleCedentials instead of the deprecated GoogleCedential
I have java code to connect to google drive using a service account, this works:
JsonFactory JSON_FACTORY = new GsonFactory();
GoogleCredential credential = GoogleCredential.fromStream(new ...
1
vote
1
answer
137
views
Request had insufficient authentication scopes error when creating teacher through Google Classroom API
I'm trying to create assignments for students through the google classroom api. However, I've learned admins can not do that, only teachers. So in our code, after creating a new course we're then ...
1
vote
1
answer
59
views
Gmail service insert MimeMessage
I have Problem when calling Gmail service to insert a MimeMessage
GoogleCredential credential = new GoogleCredential.Builder()
.setTransport(httpTransport)
....
0
votes
1
answer
203
views
What is the corect version of google-api-client for use with Admin SDK API?
I am trying to execute this google's directory api to signout users from my application.
which is a POST call
POST https://admin.googleapis.com/admin/directory/v1/users/{userKey}/signOut
where ...
1
vote
2
answers
305
views
GoogleMail: Refresh Access Token with OAuth 2.0
I have below method to get Google Mail credential. However Access Token is short lived and expire after 24 hours. How to refresh it?
My method:
private static Credential getCredentials(final ...
1
vote
1
answer
872
views
Insufficient Permission: Request had insufficient authentication scopes. Google Drive
i tries to add member to my google sheet using java code, but it doesn't work.
I use OAuthor 2.
Can anyone help me with this problem? Thanks very much.
My code:
public static void main(String... args) ...
1
vote
0
answers
40
views
How to access from Java Client to SOAP Server using Custom Binding properties
I try to write java client to access a SOAP Server which is already used for another clients.
SOAP Server built with .Net envirement which I didn't know that part. I have given the wsdl and some files ...
1
vote
1
answer
59
views
Googledrive API: Shared Drive access control
I was able to create a shared drive under my profile.
I created Service Account (E.g: test@svc.company.net)
I created G-Suite Account (E.g: test@integration-24524514.iam.gserviceaccount.com) from ...
1
vote
1
answer
478
views
Google drive API store credentials for java
I am developing a spring-boot application that needs to upload files to a Google Drive account. I found a thread for storing the access_token, and refresh token, but was deprecated, here is the link: ...
0
votes
1
answer
162
views
Google Cloud Platform - Java API Client Library - Cloud Run - Add IAM Policy Binding for a service
I have researched enough and I am getting nowhere. Hoping I can get some help here.
In GCP, How can I add a new IAM policy binding for a Cloud run service using Java API client library SDK?
Simply put,...
1
vote
0
answers
445
views
Google calendar api watch method for events set up with Kotlin/Java
I'm trying to set up Push Notifications for Google Calendar using Kotlin and V3 api.
This is my class that contains functions for CRUD operations with events:
import com.google.api.client.auth.oauth2....
0
votes
1
answer
79
views
Cancel google OAuth2 authorization
I am creating a java desktop app that needs access to Google APIs.
I authorize the application like this:
Details credentialDetails=...;
List<String> scopes=...;
GoogleClientSecrets ...
1
vote
1
answer
167
views
FileOutputStream throw FileNotFoundException when get File with Japanese in path
When using Google Drive API, I'm having this downloadMetadataFile() here to handle file:
public void downloadMetadataFile(String fileId, String folderStorePath, String fileName) throws IOException, ...
0
votes
0
answers
80
views
auto generate Google sheets file from csv file by Google drive api
When using Google Drive, I see that Google drive will auto generate a Google sheet file when I open a CSV file with "open with" option in browser and will store that auto generate Google ...
1
vote
0
answers
244
views
GoogleCredential deprecated
Trying to get Gmail service and it should up the message 'com.google.api.client.googleapis.auth.oauth2.GoogleCredential' is deprecated.
Here is my code snippet.
import com.google.api.client.auth....
0
votes
1
answer
669
views
Why deleted file still show up in result while query by Google Drive API
I am doing a service automatic generate file and upload it to google drive using Spring boot and java 8. This is an external service of another bigger service.
The Google environment I'm using:
...
0
votes
1
answer
206
views
How to config Google json key file as Spring core Resource?
I'm developing a Spring boot application in Java 8. I'm trying to get the Google credential json file as spring core Resource object but it is not working. I have debug and see that the ...
0
votes
0
answers
100
views
Google Calendar event etag decreases which leads to 'ifMatch' patching failure
My code modifies calendar events using Google Calendar API and it's subscribed to event changes (via calendars sync tokens, not push notifications, if it matters).
Changing event time from 'since X ...
1
vote
1
answer
419
views
How to create Credential from service account key file?
I am doing a service automatic generate file and upload it to google drive using Spring boot and java 8. This is an external service of another bigger service.
I can't found any instruction about ...
1
vote
2
answers
121
views
Cannot impersonate service account to create calendar events
I'm trying to implement user impersonation with a google service account and have been having problems for a while, this is the code I am using in Java:
GoogleCredential credential = GoogleCredential
...