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
- DingkunXieAug 16, 2023
Microsoft
It will aggregate results for everyone, but you can filter by user name (email address) since the results contain that identifying information.- jshaunBTCAug 16, 2023Copper ContributorGreat thanks, Dingkun Xie, I'll let you know when Ive gone back to it and will mark you as bets response.
- jshaunBTCAug 17, 2023Copper ContributorUsing GetAggregateQuizData uri returns the following failure:
Unexpected response from the service
clientRequestId: 2c821506-a025-4e00-a49e-0ffdeb75bda4
Can I confirm, is the userID in the query params the owner of said form?