Hello Every one!! I want to create a folder on Goo...
# suitescript
n
Hello Every one!! I want to create a folder on Google Drive using User Event script once a transaction is created!! Could you please let me know if there are any resource available for Gdrive APIs with Netsuite which I can check and use it for the same!! Thanks!
z
Try to create REST client with N/https module if Google Drive has option for https REST
n
Hi @Zoran R-DATAGRAM can I create that in UE script ? we need the url, code and redirect url somethings like that right for the connection! can I get the resource of the something like that!!? Thanks
c
@Nilesh Patil This API is the one you're looking for https://developers.google.com/drive/api/v2/reference/files/insert
Like Zoran said, you can use N/https to send data to that API
I'd create a rest client as a generic suitescript module (using N/https) then I'd create the userevent script to handle the user event and business rules.
message has been deleted
n
Hi @Craig!! Its for file right!! Thanks!! but actually I need it for creating a folder!
c
@Nilesh Patil which part of your struggling with, the picking the correct API?
n
this is for creating files! can I create folders using the same in Gdrive?
c
@Nilesh Patil a folder in gdrive is just a file
You need to set the correct mimetype
n
oh Okay! understood!
n
rest client means? the restlet and client script?
c
• "a folder is a file with the MIME type 
application/vnd.google-apps.folder
 and with no extension."
rest client refers to a SuiteScript that handles the REST calls.
You can encapsulate that into a single file/SuiteScript module as to not mixed it up with your business rules.
n
so It will be a client script which will handle the rest calls right?
c
No
The rest calls should be handled in a SuiteScript file
just a generic module.
and the business logic in the user event script (assuming you want to trigger this via an event)
n
do you have any resource where I can understand this? could you please send me that?
rest client ss
Thanks @Craig! for your kind information!!
c
The rest client would just be an SS script with a few functions using n/https api to send data.
You could just put the rest code directly into your UE script if the idea of encapsulation is too much for you. I’m not sure what resource I can point you to because I don’t know what part you’re struggling with. Have you got any software engineering and suite script experience or are you starting from zero? Look at all the pieces of the solution and tell me which part you don’t understand. Don’t get caught up on the ‘rest client’, it’s just a bunch of functions that use n/https api calls e.g. https.post()