BIMOne.GoogleSheets package. Get.GoogleSheetsInGoogleDrive operation failed

Hi, there!
Thanks to @vincent.cadoret for BIMOne.GoogleSheets

I set up the console for my API, generated “Credentials.json” and imported them to the mentioned folder.
Everything as it is explained in the documentation.

It does not work for me so far. What should I do next?

Hi @s.semashka, can you give it another try today? Sometimes it takes a little while for Google’s systems to sync up the permissions. If it still doesn’t work, I’m wondering if Google has made breaking changes to the formatting of the credentials file…

Hi, @vincent.cadoret
Thank you for your reply.
I run the script today, and unfortunately, it is still not working.

@s.semashka What version of Revit / Dynamo are you using? I see you are in the 2.2 folder… is that the correct folder for the version of Dynamo you are running the script in? Is it possible that the credentials file is in the folder for the wrong version (it’s happened to me before…)?

@vincent.cadoret, thank you for your reply.
I believe that it is the right folder according to the version.
Dynamo-Revit

@s.semashka I still think that it’s because it’s not finding the credentials file.

Here is the code that creates the path to the credentials file:

static string assemblyPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
static string credentialsPath = Path.Combine(assemblyPath, @"…\extra\credentials.json");

It gets the path relative to the currently executing assembly (aka current version of Dynamo that is running). It goes back up one folder from the DLL and then back into the “extra” folder.

What version of Revit are you running this in?

Dear @vincent.cadoret, sorry for the late reply.
I double-checked it - the credentials.json file seems to be in the right place.
I am using the Dynamo in the Revit 2020.1.
Does the BIMOne.GoogleSheets package work on your computer?

It is working for me, however 2020.1 is outdated, you should be on 2020.2.2 and then it should show this Dynamo version:
image

Can you try updating to see if that helps?

@vincent.cadoret thank you for your reply.
Before I update to Revit 2020.2 or 2021 could you take a look at my Google console?
Maybe this can be the source of the problem?

@s.semashka I had same issue and tried another way for authentication and it worked out. I am not sure if it is consistent solution but maybe @vincent.cadoret could correct us for that.

First create a new project following steps 2.i. and 2.ii. from the link (https://github.com/bimone/BIMOne.GoogleSheets)

Go to Project “Dashboard” and choose “Google Drive API”. Click to “Create Credentials”. Then set up settings like in the images below.

After clicking “what credentials do I need?”, insert a random service name and account ID (e.g. bimone).

Follow steps 2.iii. and 2.iv. but don’t add scopes in step 2.iv. (https://github.com/bimone/BIMOne.GoogleSheets)

Then follow the rest of the steps (2.v. & 2.vi. & 2.vii.), and rename the folder as “credentials” in step 2.vi.

You can use BatchAppendData or WriteData nodes in BimOne package to export the data.

After you run the script, Google might send an error, just click to “more info” and change settings to give access permission to drive.

If your solution works I have nothing against it :slight_smile:

@s.semashka Regarding your screenshot, it should still work with that warning (ours does) it will simply show an “unverified app” screen when trying to authenticate the first time and there’s some limits and quotas. But it should work.

Are you using a Google Apps account or a regular gmail account?

Are you able to switch it to “internal” type?
image

However, right now I still think it’s a path issue to the credentials file or something changed in the Revit / Dynamo API. I will have to dig further when I get the time.

@mete.boncukcu thank you for your idea.
Unfortunately, I have not found the window you had shared here.
Maybe the recording would reveal my missteps

@vincent.cadoret thank you for your reply.
I guess I need to pay for G Suite to make it internal.

Also, I tried to run the script from Revit 2021, saving the generated credentials in the “extra” folder and did not succeed
z11

Can you please send me a screenshot of your “Manage Node and Package Paths”?
image

@s.semashka From Dashboard choose Google Drive API, then create credentials

1 Like

Thanks, @mete.boncukcu, I have found it after your explanation.
However, the issue persists in my case.
If you want to see my process, please take a look at the recording.

Here is the screenshot:


If you do not mind, you can take a look at my recording.

whats that warning at the top of the dynamo menu (green notification) - Also have you tried this with only a one package installed?

2 Likes

@s.semashka thanks for sharing record.

The steps that you are following in the record seem to be correct.

Maybe you can rename your file (in Step 2.vi.) as “credentials”, rather than “credentials.json”. That’s how it works in my case.

If it doesn’t work out, can you follow all these steps after you create new project in Google APIs? Because OAuth in your current project (DynamoSheets) still needs verification by Google, so better to try under the new project (Step 2.i.). Since you will not add scopes (ignore step 2.iv.) in the new project, it might work without verification.

1 Like

Here’s the code that builds the path to the credentials.json file:


As you can see, the file must be name credentials.json since the name is currently hard coded.

Also, I would try what @Michael_Kirschner2 suggested.

I still think it’s something related to the path to the file since this is the only reason for that exception to be thrown:

Hopefully, with everyone’s help we can get to the bottom of this!

1 Like