cancel
Showing results for 
Search instead for 
Did you mean: 

Precondition check failed error using Gmail API v1

StevenCheng
Level 2
Does anyone get it to work?  I get the following error to use gmail.users.messages.list or gmail.users.messages.read.

Internal : Unexpected error Error during Web API HTTP Request
HTTP Status Code: 400
HTTP Response Content: {
"error": {
"code": 400,
"message": "Precondition check failed.",
"errors": [
{
"message": "Precondition check failed.",
"domain": "global",
"reason": "failedPrecondition"
}
],
"status": "FAILED_PRECONDITION"
}
}

------------------------------
Steven Cheng
IT Application Advisor
Celestica Inc.
America/Toronto
------------------------------
15 REPLIES 15

Hi, @Arthanareeswara,

this means it works now! Congratulations :)!

The API call will return JSON which is what you got. I assume you called a function (getProfile) which returns email address, number of messages, number of threads and some historyId.

So what you want to do with this? - this is important question. Or what do you try to achieve?

Regards,



------------------------------
Zdeněk Kabátek
Head of Professional Services
NEOOPS
http://www.neoops.com/
Europe/Prague
------------------------------

Hi Zdeněk Kabátek: No I am not getting successfull response while executing the APi Call from Blueprism only If  execute the API Call via below link I am getting successful response!

https://developers.google.com/gmail/api/reference/rest/v1/users.messages/get

While I execute the code from Blueprism I am getting error as attached in my last thread. Please let me know what I am doing wrong...

Regards,
Aadhi.


------------------------------
Arthanareeswaran Chandrasekaran
Technical Lead/ Architect
IBM
Asia/Singapore
------------------------------

@Arthanareeswara,

Lets review a few things.

1) You've got a subscription (free or otherwise) to Google G Suite?
2) You've enabled the GMail API in your Google console?
3) You've created a service account in the Google console under "APIs & Credentials"?
4) You've added the service account details (email address and private key) to a OAuth 2.0 (JWT Bearer Token) credential in Blue Prism?
8790.png

5) You've associated that credential with the Google GMail Web API definition in Blue Prism and updated the Common Authentication details as mentioned previously?
8791.png

Cheers,

------------------------------
Eric Wilson
Director, Partner Integrations for Digital Exchange
Blue Prism
------------------------------

Hi @Arthanareeswara

Were you able to successful establish Gmail PI in Blueprism. I am facing issues while making Gmail API connection. I have created a ser​vice account in Gmail and generated the private key. I used the entire value of private key starting from ----BEGIN PRIVATE KEY---- to   -----END PRIVATE KEY----

I am seeing the below error :Unexpected error Failed to get OAuth2.0 Access Token : "The operation has timed out" ""

In Private key I used the  syntax: 

-----BEGIN PRIVATE KEY-----

[privatekey]

-----END PRIVATE KEY----- 

I I removed the \n with next line before copying the key into credentials of blueprism.
Please help



------------------------------
Sukhmanpreet Kaur Bhullar
------------------------------

@Sukhmanpreet_Ka,

Are you working against a Google Workspace environment? If not, you won't be able to access the GMail API. It is only supported on Google Workspace. You can still use IMAP and SMTP for simple access to a GMail mailbox though.

Cheers,


------------------------------
Eric Wilson
Director, Integrations and Enablement
Blue Prism Digital Exchange
------------------------------

Hi @ewilson, We are using Gmail API against Google Workspace environment. Could you please help me solve the issue I am facing with Gmail API.

​Thanks,
Sukhman

------------------------------
Sukhmanpreet Kaur Bhullar
------------------------------