Forum Discussion
Query Forms API to get scores or results from form submission
Use below API to get the form definition which contains the answer and points information per question -
GET https://forms.office.com/formapi/api/{TenantId}/users/{UserId}/light/forms('FormId')?$select=id,order,otherInfo,questions($expand=choices)
e.g.,
"questionInfo": "{\"Choices\":[{\"Description\":\"Option 1\",\"IsGenerated\":true,\"IsAnswerKey\":true},{\"Description\":\"Option 2\",\"IsGenerated\":true,\"IsAnswerKey\":false}],\"ChoiceType\":1,\"AllowOtherAnswer\":false,\"OptionDisplayStyle\":\"ListAll\",\"ChoiceRestrictionType\":\"None\",\"ShowRatingLabel\":false,\"Point\":10}",
Use below API to get the aggregated results which contains responses and total score -
GET https://forms.office.com/formapi/api/{TenantId}/users/{UserId}/forms('FormId')/GetAggregateQuizData
e.g.,
"quizSummaryData": {
"averageScore": 10.0,
"averageSubmitTimeSeconds": 2.0,
"count": 1
DingkunXie What is your source for this information?
- DingkunXieJun 18, 2024
Microsoft
This is how we implement it in our service.- jawadahmedAug 13, 2024Copper Contributor
Any idea on how to access this API using Power Automate? Recently, we've encountered problems with this API; it used to work with Power Automate but has not been functioning for the past week.
Connection: Send an HTTP request to SharePoint
{
"status": 401,
"message": "{\"error\":{\"code\":\"701\",\"message\":\"Required user login.\"}}\r\nclientRequestId: xxxxx",
"source": "https://forms.office.com/formapi/DownloadExcelFile.ashx?formid=XXXXXXX",
"errors": []
}We attempted to use the Forms synchronized Excel file from SharePoint, but it only updates with the actual form data when accessed through a browser.
- dfo222Aug 29, 2024Brass ContributorI've had the same problem - working great for ages, then it's suddenly stopped working.