Google Drive Service Accounts API using Google Service Account Authorization with JWT

Hi Wapplers,

I am trying to connect to Google Drive API using Google Service Account Authorization with JWT. I followed the following instructions: Google Service Account Authorization with JWT

However, I am getting an error as follows:

Any idea whats going on?

You can’t just get the schema like that from within this dialog, you’re not authorized there.
Just copy and paste the json structure of the expected response from google docs.

oooh… where do I paste the json reponse? I found this… https://developers.google.com/drive/picker/reference/results

In the schema editor dialog … :slight_smile:

Thanks… I am a bit lost with this to be honest. Do I need to write server side code to be able to use Google Drive? I am tryign to create files on google drive, upload files and move files from one folder to another. How do I do this from the client side of Wappler?

Not sure what you mean? Why would you need to write serverside code?

On this screenshot:

I saw that you were trying to fetch the schema, but that’s not possible from within this dialog, as the API requires authentication and JWT token.
That’s why i suggested you to copy the schema from the docs, if you want to have it there defined.
The schema is only used for the data pickers in Wappler.

Yeah I see what you saying. Just wondering aside from that do you know how I might be able to go about uploading files etc to Google Drive? Do I do it via data input in the API call or is it via Javascript on the client side etc? Like I put a button on a page and if you click on it it can call the server connect action with my API call (as you saw in the screenshot). Is that all?

So I added the API call, and setup a button on the client side to action this call. My API call is simple and looks like this:

Howeber I am getting an error:

{status: “500”, code: “MODULE_NOT_FOUND”,…}
code
:
“MODULE_NOT_FOUND”
message
:
“Cannot find module ‘jsonwebtoken’\nRequire stack:\n- /opt/node_app/lib/core/app.js\n- /opt/node_app/lib/core/middleware.js\n- /opt/node_app/lib/setup/routes.js\n- /opt/node_app/lib/server.js\n- /opt/node_app/index.js”
stack
:
“Error: Cannot find module ‘jsonwebtoken’\nRequire stack:\n- /opt/node_app/lib/core/app.js\n- /opt/node_app/lib/core/middleware.js\n- /opt/node_app/lib/setup/routes.js\n- /opt/node_app/lib/server.js\n- /opt/node_app/index.js\n at Module._resolveFilename (node:internal/modules/cjs/loader:1075:15)\n at Module._load (node:internal/modules/cjs/loader:920:27)\n at Module.require (node:internal/modules/cjs/loader:1141:19)\n at require (node:internal/modules/cjs/helpers:110:18)\n at App.setJSONWebToken (/opt/node_app/lib/core/app.js:465:21)\n at App.getJSONWebToken (/opt/node_app/lib/core/app.js:493:25)\n at OAuth2.init (/opt/node_app/lib/oauth/index.js:38:40)\n at App.setOAuthProvider (/opt/node_app/lib/core/app.js:228:32)\n at App.getOAuthProvider (/opt/node_app/lib/core/app.js:244:31)\n at App.send (/opt/node_app/lib/modules/api.js:57:41)”
status
:
“500”