Survey Responses

Use API responses to show survey questions in Salesforce.

Create a submit button or enable a trigger to call the Apex class for submitting the responses.

The SurveyApi Apex class uses the PATCH request endpoint to submit the survey responses using this format:

The invitationId property is retrieved from the POST API request. The flowInterviewState property is retrieved from the first POST API request and later from subsequent PATCH API requests.

Here’s an example for multiple questions.

If the PATCH API request is successful, the feedback is submitted and a Thank You page is displayed.