ScriptID from DeploymentID

678 views
Skip to first unread message

Michael O'Shaughnessy

unread,
Mar 29, 2022, 9:58:58 AM3/29/22
to Google Apps Script Community
Hello,

I have a deployed app acting as an API that I was working on months ago.  I am back to working on this project BUT I cannot find the script file that goes with it.

So, is is possible to find the scriptID from a deploymentID and if so, how?

Thanks in advance for any help and guidance!


dimud...@gmail.com

unread,
Mar 29, 2022, 11:23:30 AM3/29/22
to Google Apps Script Community
Looking at the Apps Script API you need the script id to fetch deployments, so there doesn't seem to be a direct/straight-forward way to go in the other direction and fetch a script id from a deployment id using the API. 

However you might be able to get that information in a round-about way via the processes list endpoint in the Apps Script API (https://developers.google.com/apps-script/api/reference/rest/v1/processes/list). You can pass a deployment Id as a property of the ListUserProcessesFilter object to fetch project info related to a process. You won't get back a Script Id in response but you will get the name of the project. So that will help to narrow things down a bit. You can then search for the project by name from your project dashboard (script.google.com/home/my).

Michael O'Shaughnessy

unread,
Mar 31, 2022, 2:29:39 PM3/31/22
to Google Apps Script Community
Thanks for the info about the "process.list"!  Unfortunately I could not find what I was looking for BUT I need to revisit this again!  In my searching for what I needed I did learn uncover some interesting things about it.  

Not all is lost however, I got to thinking  as I was filling in boxes for the process.list API, what if I just tried to go to the url that has the deployment ID?  I logged into an account that I know I would not have used, pasted the URL and got a "request for access" page!!!  I submitted my request, waited for my phone to "ding" and when it did, I could tell by the email what account I used and most importantly the name of the script!!!
Reply all
Reply to author
Forward
0 new messages