MS Forms API implementation

Copper Contributor

Hi,

 

I am looking for MS Forms API documentation where I can find out more information about the implementation. 


How do we authenticate our system against the MS Forms API where the implementation occurs?

Where do all the responses in MS Forms get stored? 

Is it possible to purge the responses of MS Form from the persistence storage?


Much appreciated!

10 Replies

@hedecan there's very little documentation out there but you can view the forum response here which will give you some info.

 

The responses are stored depending on your location, so that could be UK, Europe, Australsia, North America etc.

 

You can delete all the responses for a form with a flow in Power Automate that sends an HTTP request to the api:

 

1-Flow.png

 

2-Flow.png

 

3-Flow.png

 

Rob
Los Gallardos
Microsoft Power Automate Community Super User

Thanks @RobElliott 

 

Regarding the data storage location, is that linked to the Azure tenant's location or any other condition?

 

I just want to make sure it is located within Australia where I am located.

 

Thanks

@RobElliott 

I have tried to implement your solution but it does not work.

It does not delete the response.

 

@lhaydee just saying it doesn't work with no other information doesn't really help us to help you. Could you give a screenshot of your flow?

@RobElliott Hi Rob:

The flow looks like this:

 

lhaydee_0-1676906613162.png

First action search the user id

Second compose tenant id

Third, Forms id

Four, Http request 

 

@lhaydee But you're trying to do something different to what the original post and my solution was about. My solution deleted all responses in the spreadsheet behind the form. It looks like you want to delete the responses from a specific responder. I don't know if this is possible, I've never done it, so someone else might have to give you a solution here.

 

@RobElliott Misunderstood the reply. Sorry!

I thought your flow idea allowed to force the deleting of the response.

 

In my opinion, this field, Forms365, needs to expand on PowerAutomate because there is little info, action and conectors available limiting the possibilities to implement flows.

 

Anyway, thanks a lot for your response and time.

 

Leticia

Not sure what do you want to achieve... Do you want to delete all answers from an specific user in a single Form?

Well, just in case you are still interested in how to delete responses from an specific user, here is an approach that I tried and it's working for me.

First of all, you need to understand the structure of the Forms API.

https://forms.office.com/formapi/api/[TenantID]/users/[UserID]/forms('[FormID]')/responses



[TenantID] - no doubts about it, tenant ID where the form is hosted.
[UserID] - is the UserID of the Form owner.
[FormID] - no doubts about this.

If you try this API and take a look to the JSON, you will see each response has an ID.

To delete a single ID, you just need to use the delete method specifying the response ID.

https://forms.office.com/formapi/api/[TenantID]/users/[UserID]/forms('[FormID]')/responses([ResponseID])


But if you need to delete all responses from specific user, you may use the first API call to collect all responses, parse the JSON, filter the array by responder property. Just note the responder property uses the responder UPN, not the email.

Now you have an array with the responder UPN and the response ID, just use an apply to each loop to delete each response.