Creating folder in Google Drive

441 views
Skip to first unread message

al...@wedosoft.net

unread,
Mar 29, 2017, 8:47:54 PM3/29/17
to Fujitsu RunMyProcess Developer Community
Hello,

I would like to create new folder in Google Drive. But I couldn't find connector in libraries.
There is only "Creating an empty spreadsheet".

Provider : https://www.googleapis.com/drive/v3/
Connector url : files

Post Content :

<#if parent_id?? && parent_id!= "">
{
"name":"${spreadsheet_name}",
"mimeType":"application/vnd.google-apps.spreadsheet",
"parents": [{"id":"${parent_id?default('')}"}]
}
<#else>
{
"name":"${spreadsheet_name}",
"mimeType":"application/vnd.google-apps.spreadsheet"
}
</#if>

Like above, How can I make new folder using connector? Even though trying to search in developers.google.com, I couldn't find http rest api descriptions.

Would you help this?

Regards,
Alan.

Abhilash Sambhare

unread,
Mar 30, 2017, 8:59:10 AM3/30/17
to Fujitsu RunMyProcess Developer Community
Hi Alan,

Please find below connector configuration for creating folder into Google drive:

Connector Url:drive/v2/files

Post Content:
<#if parent_id?? && parent_id!= "">

{
"title": "${title}",

"mimeType": "application/vnd.google-apps.folder",
 
"parents": [{"id":"${parent_id}"}],

"shared":"${shared}"
}

<#else>

{
"title": "${title}",

"mimeType": "application/vnd.google-apps.folder",

"shared":"${shared}"
}

</#if>

Input Parameters of Connector are:

1.title : The title of your folder.

2.access_token : you can get it with the Login Documents webservice from the Google API Login provider.

3.shared: Whether the file has been shared it requires a boolean value true/false.

4.parent_id: id of the folder where you want to put the file. If not set, the folder will be created at the root of the google Drive


Please try with this configuration.If you are still facing any issues kindly let us know.


Thanks & Regards,
Abhilash
Fujitsu Runmyprocess Support


--
Fujitsu - RunMyProcess
---
You received this message because you are subscribed to the Google Groups "Fujitsu RunMyProcess Developer Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to supportforum+unsubscribe@runmyprocess.com.
To post to this group, send email to suppor...@runmyprocess.com.
Visit this group at https://groups.google.com/a/runmyprocess.com/group/supportforum/.
To view this discussion on the web visit https://groups.google.com/a/runmyprocess.com/d/msgid/supportforum/a2651782-a455-4f86-8419-f7c60669e131%40runmyprocess.com.
For more options, visit https://groups.google.com/a/runmyprocess.com/d/optout.

al...@wedosoft.net

unread,
Mar 30, 2017, 11:00:19 PM3/30/17
to Fujitsu RunMyProcess Developer Community
> To unsubscribe from this group and stop receiving emails from it, send an email to supportforum...@runmyprocess.com.
Hello Abhilash,

Thanks for helping. It works well! I got one more question. After creating folder, I would like to create spreadsheet file in that folder.

So I tried like below.

Get refresh token > Get access token > Create folder > create spreadsheet > writing in sheet.

In this process, api scope is like this.

Get refresh token content :

code=${authorization_code?url}&redirect_uri=${"https://live.runmyprocess.com/live/.../appli/346852?P_mode=TEST"?url}&client_id=${"..."?url}&scope=${"https://docs.google.com/feeds https://spreadsheets.google.com/feeds https://www.googleapis.com/auth/drive https://www.googleapis.com/auth/drive.file https://www.googleapis.com/auth/drive.appdata https://www.googleapis.com/auth/drive.apps.readonly"?url}&client_secret=${"..."?url}&grant_type=authorization_code


Creating spreadsheet connector :

Provider url :
https://www.googleapis.com/

Connector url : drive/v3/files


Content :

<#if parent_id?? && parent_id!= "">
{
"name":"${spreadsheet_name}",
"mimeType":"application/vnd.google-apps.spreadsheet",
"parents": [{"id":"${parent_id?default('')}"}]
}
<#else>
{
"name":"${spreadsheet_name}",
"mimeType":"application/vnd.google-apps.spreadsheet"
}
</#if>

Lastly, When I test process, it occured error in creating spreadsheet activity.

Forbidden (403) - The server understood the request, but is refusing to fulfill it (1 attempt)


{
"error": {
"errors": [
{
"domain": "global",
"reason": "insufficientPermissions",
"message": "Insufficient Permission"
}
],
"code": 403,
"message": "Insufficient Permission"
}
}

I found some doucments and it means there is not enough permission to execute that action. So I added

https://www.googleapis.com/auth/drive
https://www.googleapis.com/auth/drive.file

But still occured error.

Can you help this more?

Regards,
Alan.

Abhilash Sambhare

unread,
Apr 2, 2017, 10:01:31 AM4/2/17
to Fujitsu RunMyProcess Developer Community
Hi Alan,

Can you please try with the following api scope:



You are facing  this error due to following reasons:

1.Access token  generated in the process seems to get expired.

2.Api scope is not correct.

For more information about Google Spreadsheet Api,Please refer the link:https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets/create

Thanks & Regards,
Abhilash Sambhare
Fujitsu Runmyprocess Support 


To unsubscribe from this group and stop receiving emails from it, send an email to supportforum+unsubscribe@runmyprocess.com.

To post to this group, send email to suppor...@runmyprocess.com.
Visit this group at https://groups.google.com/a/runmyprocess.com/group/supportforum/.

al...@wedosoft.net

unread,
Apr 3, 2017, 6:31:58 PM4/3/17
to Fujitsu RunMyProcess Developer Community
2017년 4월 2일 일요일 오후 11시 1분 31초 UTC+9, abhilash.sambhare 님의 말:
Hi Abhilash,

Thanks for reply. Regarding access token, before creating spreadsheet, there is a activity which create new folder and it works well. So access token is not expired.

Regarding scope, I applied https://www.googleapis.com/auth/drive, https://www.googleapis.com/auth/spreadsheets and re-get refresh token, access token but it is still same.

Regarding sheet api v4, would you ping me provider url and connector url? I couldn't find HTTP request dcoument in tech note of what you sent.

Regards,
Alan.


al...@wedosoft.net

unread,
Apr 3, 2017, 6:57:19 PM4/3/17
to Fujitsu RunMyProcess Developer Community, al...@wedosoft.net
2017년 4월 4일 화요일 오전 7시 31분 58초 UTC+9, al...@wedosoft.net 님의 말:
Hi Abhilash,

I found the reason. connector and provider url is ok. but content should be removed. When I remove post content, it works well.

Thanks for helping!

Regards,
Alan.
Reply all
Reply to author
Forward
0 new messages