从定义 ID 派生 Google 表单视图 ID
Derive a Google Form View ID from the Definition ID
当我定义一个表单时,它有 url:
https://docs.google.com/a/domain.com/forms/d/1d2Y9R9JJwymtjEbZI6xTMLtS9wB7GDMaopTQeNNNaD0/edit
我添加完我希望表格包含的问题并使用 "Send" 按钮分发我的表格,我没有单击 "Include form in email" 复选框。我将表格通过电子邮件发送给的人现在收到并通过电子邮件邀请他们填写表格,当他们这样做时,他们最终会出现在包含以下内容的页面上 url:
在我的 AppEngine / Python 2.7 代码中,我只能访问此 ID - '1d2Y9R9JJwymtjEbZI6xTMLtS9wB7GDMaopTQeNNNaD0' - 我的问题是如何从这个原始定义 ID 获取视图 ID - '1FAIpQLScINR5rudwEKNVwlvz45ersqk_SO0kNcyN_EM1tJe3mXeFksw'
我尝试使用 Google 驱动器 v2 和 v3 REST API 来检索 'definition' 文件,但响应没有(我可以看到)对此的引用'view' 编号。
我也尝试过使用 Google AppsScript FormApp API 来检索 'definition' 表单,但这也不包含对 'view' id 的引用(我可以看到)。
在我尝试过的所有情况下,如果我使用 'view' ID 作为来源 API 的 return 404 错误表明此 'view' ID 不是一个 Google 驱动器文件。
有什么想法吗?
使用 Google Apps 脚本发布 Web 应用程序(或使用执行 API)来利用 "getPublishedUrl" 函数
function doGet(theRequest){
var theDefinitionId = theRequest.parameters.formId;
var thePublishedUrl = myAPI_(theDefinitionId);
var output = ContentService.createTextOutput(thePublishedUrl);
output = output.setMimeType(ContentService.MimeType.JSON);
return output;
}
function myAPI_(theDefinitionId){
var thePublishedUrl = null;
try{
var existingForm = FormApp.openById(theDefinitionId);
thePublishedUrl = existingForm.getPublishedUrl();
} catch (err){
Logger.log(err);
}
var theReturn = {publishedUrl: thePublishedUrl};
var theJSONReturn = JSON.stringify(theReturn);
return theJSONReturn;
}
当我定义一个表单时,它有 url:
https://docs.google.com/a/domain.com/forms/d/1d2Y9R9JJwymtjEbZI6xTMLtS9wB7GDMaopTQeNNNaD0/edit
我添加完我希望表格包含的问题并使用 "Send" 按钮分发我的表格,我没有单击 "Include form in email" 复选框。我将表格通过电子邮件发送给的人现在收到并通过电子邮件邀请他们填写表格,当他们这样做时,他们最终会出现在包含以下内容的页面上 url:
在我的 AppEngine / Python 2.7 代码中,我只能访问此 ID - '1d2Y9R9JJwymtjEbZI6xTMLtS9wB7GDMaopTQeNNNaD0' - 我的问题是如何从这个原始定义 ID 获取视图 ID - '1FAIpQLScINR5rudwEKNVwlvz45ersqk_SO0kNcyN_EM1tJe3mXeFksw'
我尝试使用 Google 驱动器 v2 和 v3 REST API 来检索 'definition' 文件,但响应没有(我可以看到)对此的引用'view' 编号。 我也尝试过使用 Google AppsScript FormApp API 来检索 'definition' 表单,但这也不包含对 'view' id 的引用(我可以看到)。 在我尝试过的所有情况下,如果我使用 'view' ID 作为来源 API 的 return 404 错误表明此 'view' ID 不是一个 Google 驱动器文件。
有什么想法吗?
使用 Google Apps 脚本发布 Web 应用程序(或使用执行 API)来利用 "getPublishedUrl" 函数
function doGet(theRequest){
var theDefinitionId = theRequest.parameters.formId;
var thePublishedUrl = myAPI_(theDefinitionId);
var output = ContentService.createTextOutput(thePublishedUrl);
output = output.setMimeType(ContentService.MimeType.JSON);
return output;
}
function myAPI_(theDefinitionId){
var thePublishedUrl = null;
try{
var existingForm = FormApp.openById(theDefinitionId);
thePublishedUrl = existingForm.getPublishedUrl();
} catch (err){
Logger.log(err);
}
var theReturn = {publishedUrl: thePublishedUrl};
var theJSONReturn = JSON.stringify(theReturn);
return theJSONReturn;
}