用于处理表单门户上提交的表单的API apis-to-work-with-submitted-forms-on-forms-portal
AEM Forms提供了可用于查询通过表单门户提交的表单数据的API。 此外,您可以使用本文档中介绍的API发布注释或更新已提交表单的属性。
NOTE
必须将调用API的用户添加到审阅人组,如将提交审阅人关联到表单中所述。
GET/content/forms/portal/submission.review.json?func=getFormsForSubmissionReview get-content-forms-portal-submission-review-json-func-getformsforsubmissionreview-br
返回所有符合条件的表单的列表。
URL参数 url-parameters
此API不需要其他参数。
响应 response
响应对象包含一个JSON数组,其中包含表单名称及其存储库路径。 响应的结构如下:
[
{formName: "<form name>",
formPath: "<path to the form>" },
{.....},
......]
示例 example
请求URL
https://[host]:[port]/content/forms/portal/submission.review.json?func=getFormsForSubmissionReview
响应
[{"formPath":"/content/dam/formsanddocuments/forms-review/form2","formName":"form2"},{"formPath":"/content/dam/formsanddocuments/forms-review/form1","formName":"form1"}]
GET/content/forms/portal/submission.review.json?func=getAllSubmissions get-content-forms-portal-submission-review-json-func-getallsubmissions
返回所有已提交表单的详细信息。 但是,您可以使用URL参数来限制结果。
URL参数 url-parameters-1
在请求URL中指定以下参数:
响应 response-1
响应对象包含一个JSON数组,该数组包含指定表单的详细信息。 响应的结构如下:
{
total: "<total number of submissions>",
items: [{ formName: "<name of the form>", formPath: "<path to the form>", owner: "<owner of the form>"},
....]}
示例 example-1
请求URL
https://[host]:[port]/content/forms/portal/submission.review.json?func=getAllSubmissions&formPath=/content/dam/formsanddocuments/forms-review/form2
响应
{"total":1,"items":[{"formName":"form2","formPath":"/content/dam/formsanddocuments/forms-review/form2","submitID":"1403037413508500","formType":"af","jcr:lastModified":"2015-11-05T17:52:32.243+05:30","owner":"admin"}]}
POST/content/forms/portal/submission.review.json?func=addComment post-content-forms-portal-submission-review-json-func-addcomment-br
向指定的提交实例添加注释。
URL参数 url-parameters-2
在请求URL中指定以下参数:
参数
描述
submitID
指定与提交实例关联的元数据ID。
Comment
指定要添加到指定提交实例的注释文本。
响应 response-2
在成功发布评论时返回评论ID。
示例 example-2
请求URL
https://[host:'port'/content/forms/portal/submission.review.json?func=addComment&submitID=1403037413508500&comment=API+test+comment
响应
1403873422601300
GET/content/forms/portal/submission.review.json?func=getComments get-content-forms-portal-submission-review-json-func-getcomments-nbsp
返回在指定提交实例上发布的所有评论。
URL参数 url-parameters-3
在请求URL中指定以下参数:
参数
描述
submitID
指定提交实例的元数据ID。
响应 response-3
响应对象包含一个JSON数组,该数组包含与指定提交ID关联的所有注释。 响应的结构如下:
[{
owner: "<name of the commenter>",
comment: "<comment text>",
time: "<time when the comment was posted>"},
{ }......]
示例 example-3
请求URL
https://[host]:'port'/content/forms/portal/submission.review.json?func=getComments&submitID=1403037413508500
响应
[{"owner":"fr1","comment":"API test comment","time":1446726988250}]
POST/content/forms/portal/submission.review.json?func=updateSubmission post-content-forms-portal-submission-review-json-func-updatesubmission-br
更新指定提交的表单实例的指定属性的值。
URL参数 url-parameters-4
在请求URL中指定以下参数:
参数
描述
submitID
指定与提交实例关联的元数据ID。
property
指定要更新的表单属性。
value
指定要更新的表单属性的值。
响应 response-4
返回包含有关所发布更新的信息的JSON对象。
示例 example-4
请求URL
https://[host]:'port'/content/forms/portal/submission.review.json?func=updateSubmission&submitID=1403037413508500&value=sample_value&property=some_new_prop
响应
{"formName":"form2","owner":"admin","jcr:lastModified":1446727516593,"path":"/content/forms/fp/admin/submit/metadata/1403037413508500.html","submitID":"1403037413508500","status":"submitted"}
recommendation-more-help
19ffd973-7af2-44d0-84b5-d547b0dffee2