How to rename project with Google Apps Script API - google-apps-script-api

Is there any way to rename Google Apps Script project using API? I can't find any appropriate method for this.
UPD: I want to change Project's name like

You can modify the project name of the container-bound script type using Drive API. In order to use this, please retrieve the project ID, retrieve access token and enable Drive API.
End point :
PATCH https://www.googleapis.com/drive/v3/files/### project ID ###
Request body :
{
"name": "### Modified name ###"
}
Note :
In Google Drive, the project name is the same to the filename of the project.
Unfortunately, in the current stage, the project ID cannot be retrieved from Spreadsheet. But by the recent update, the file ID of Spreadsheet got to be able to be retrieved from the project of the container-bound script type. I would like to expect that the project ID will be retrieved from Spreadsheet in the future.
Reference :
Files: update

Related

Correctly enter the site_ID using Graph SDK

Regarding this expression to create a folder:
POST /sites/{site-id}/drive/items/{parent-item-id}/children
What is the correct way to enter the {site-id} and the {parent-item-id}, to access a folder (eg:folder_1) in a site (eg: site1)in a domain (eg: mydomain)
I have tried:
POST /sites/mydomain/drive/items/site1/folder_1/children
POST /sites:/mydomain/site1:/drive/items/folder_1/children
and similar, with no success,
Can you help me please?
THanks for the help.
Follow your steps, but In the second step, you say:
"This is the sub folder named "2019" in default Documents library:"
With this, I can acess the shared documents folder inside the site. I don't want to acess that folder. I need to acess another folder that is in the site, but not inside the share documents folder.
Any clue?
Do a get request like this in Graph Explorer with this request:
https://graph.microsoft.com/v1.0/sites/<host>:<server relative url>
Example:
https://graph.microsoft.com/v1.0/sites/zheguo.sharepoint.com:/sites/dev
Then will return site Id
Update if you want to access other library folder in Graph, firstly get drive id with this endpoint:
https://graph.microsoft.com/v1.0/sites/{site-id}/drives
Then access the specific drive folder with this endpoint:
https://graph.microsoft.com/v1.0/sites/{site-id}/drives/{drive-id}
Then for "parent-item-id", it's the specific folder id in document library, you can get with this endpoint:
https://graph.microsoft.com/v1.0/sites/{site-id}/drives/{drive-id}/items/root:
Example:
https://graph.microsoft.com/v1.0/sites/zheguo.sharepoint.com,91a47a59-db5e-4d17-a689-479ee8905533,274459c9-4c96-42bf-9b96-838ffa387aaa/drives/b!WXqkkV7bF02miUee6JBVM8lZRCeWTL9Cm5aDj_o4eqpLdqmLE2R7QosYOZt8Dyao/items/root:/
Then use the endpoint to create folder:
POST /sites/{site-id}/drives/{drive-id}/items/{parent-item-id}/children
Example:
https://graph.microsoft.com/v1.0/sites/zheguo.sharepoint.com,91a47a59-db5e-4d17-a689-479ee8905533,274459c9-4c96-42bf-9b96-838ffa387aaa/drive/items/01WU7SPCC4FNS6KOYTSJFK2MUFRITF5XQL/children
Reference:
Create a new folder in a drive

Google Cloud Natural Language Example

I have followed the getting started page closely.
https://cloud.google.com/natural-language/docs/reference/libraries#client-libraries-install-php
The example code has the following: $projectId = 'YOUR_PROJECT_ID';
I fill in my project id taken from the json file and the Google console--e.g. "$projectID = 'myproject-197218'" and I always get a fatal error with "Permission Denied."
I have set the env variable, run composer to install the library. And, I created the Google json file. I am running the example in PHP code.
I am running the code on my local server (xampp).
I figured out my problem. The Google Cloud json file was stored on my drive d:, so in the env variable I referenced it as 'GOOGLE_APPLICATION_CREDENTIALS= d:\xampp\htdocs\googapi\mproj.json', it did not work; when I moved it to the root of the c: drive and referenced it there (GOOGLE_APPLICATION_CREDENTIALS=c:proj.json), it worked fine.
Are you sure that the ID of your project is that one? I'm working in Google Cloud and I cannot see this project ID in our database, but if I type "my-project-197218" with a "-" between "my" and "project" I am able to find one project. please, to make sure that this is your correct project ID, run this command in your Google Cloud Shell to get the default project ID:
gcloud config list --format 'value(core.project)' 2>/dev/null

Delete files from Google drive using python through google drive api

I am trying to delete files from my google-drive using google drive apis for python.
I am able to retrieve the list of parents/children for a particular folder but when I try to delete one of the retrieved parent of the folder it gives me below error.
"https://www.googleapis.com/drive/v2/files/1j1sZ-0OAiTE9836bhTTpkUf3i4AFAvmG/parents/0AO-cNLqoD0BFUk9PVA? returned "Insufficient Permission">"
I have defined "https://www.googleapis.com/auth/drive" as my scope.
The same file got deleted when I tried "try this API" option from
developer-google.com but it does not work from my python code.
Is there anything else in the configuration that I need for deleting the files.
Thanks.

Docusign Template List Folder by name not working

All,
I have read and coded the following listed in documentation
https://docs.docusign.com/esign/restapi/Templates/Templates/list/
In above the following is shown
folder string
The query value can be a folder name or folder ID. The response will only return templates in the specified folder.
when I use folder id it's found but nothing is returned when I use folder name. I have verified that folder name matches
Also tried to use a "[{"name": "GTP"}]" but that will result in a error
HELP!
C#
templatesApi.ListTemplates(AccountId, new TemplatesApi.ListTemplatesOptions { sharedByMe = "true", folder = "GTP" }); // no results
templatesApi.ListTemplates(AccountId, new TemplatesApi.ListTemplatesOptions { sharedByMe = "true", folder = "bba1e719-1f38-4a1a-a8cc-03c4960de336" }); // works
It worked fine for me when I am using below API call and testing using Postman,
GET /restapi/v2/accounts/<accountId>/templates?folder=FolderName
As Amit says, the API call can use the name of a folder, but only if the folder is not a shared folder. To list the contents of a shared folder you need to use the folderId.
I have filed DocuSign internal bug report EC-1163. Please ask DocuSign customer service or your DocuSign technical contact to add your organization's information to the bug report. That will help increase its priority.
Workaround: Use the Shared Folder's id for the search.

Spotify Folder in "My Documents"

I'm trying to make an app for Spotify, but I can't get the first step to work. I have made a folder named 'Spotify' in 'My Documents' (I use Windows 7 64 Bit), and made a folder inside it named 'test'. In 'test' I put a file 'index.html' to test if I can open it in Spotify, but I can't. I have a developer account, so that can't be a problem. When I type 'spotify:app:test' in the search bar, I get something like this:
(Note, in the screenshot it says spotify:app:tutorial, but I get the exact same result as displayed when I type spotify:app:test, saying failed to load application)
Also, I use Spotify version 0.8.7.111.gaf8d06ed-245
Spotify cannot load an application unless it has a valid manifest file. The manifest documentation can be found here.
Alternatively, see the Spotify Apps Tutorial app for a working example of a valid manifest. Note that you at least need an identifier, version and name for a manifest to be considered valid.

Resources