Forum Discussion
API to access MS forms
https://forms.office.com (to get access token in browser)
https://forms.office.com/formapi/api/forms (see all forms you own)
https://forms.office.com/formapi/api/forms/{form ID} (see a specific form)
https://forms.office.com/formapi/api/forms/{form ID}/questions (see a specific form's questions)
https://forms.office.com/formapi/api/forms/{form ID}/responses (see a specific form's responses)
pjjohnson This is very helpful and has got me most of the way there, thank you.
I have given permissions for an app registration to access the microsoft forms API, with admin consent. I am using the client credential oauth 2 authentication flow to get a bearer token for this app registration to the https://forms.office.com/.default scope. However, when using that token with in the Authorization header of the API call to one of the endpoints listed, it tells me I am not logged in. I have tried using the bearer token scraped off a browser-based API call in it's place, and that works fine. So I know there's nothing wrong with my call, instead, something is wrong with my app registration authentication.
Given the error "701: Required user login", I am starting to think that app registrations just aren't working yet. But then, as you pointed out, the option is there to give Application API permissions in AD?!
How did you manage to do this? What am I missing?
- BinaryBotanyJun 13, 2022Copper Contributor
Steve_Lum Very frustratingly, no. Though I have not tried in the past pew months since I posted, so maybe something has changed? As far as I can tell, the API just isn't designed to work with a service principal.
- Steve_LumJun 10, 2022Copper ContributorHello Binary Botany - did you ever figure this out ?