Survey Responses Using Invitation Configurations (POST, PATCH)
Create responses using the invitation configuration details and
initiate the process of submitting the survey responses by making a POST request. Submit the
survey responses using the PATCH request.
You can create a survey to collect data from customers, employees, or other people
whose feedback you need. The survey responses are stored in the SurveyResponse object and the
responses to individual questions in the SurveyQuestionResponse object.
- Resource
-
/<MyDomainURL>/<AppPrefix>/survey-response
- Example
-
https://yourInstance.salesforce-scrt.com/surveys/v1/survey-response
- Available version
- v1
- Requires Chatter
- No
- HTTP methods
- PATCH, POST
- Special Access Rules
- The Feedback Management - Growth license is required to use this resource.
- Authorization
- Use the bearer token from the accessToken
request.
Authorization: Bearer <accessToken>
- Merge fields setup
- To use the participant or associated record merge fields, ensure these prerequisites
are met.
- Access level for merge fields is set to System Context - Enforce record-level access. See Select the Access Level for Merge Fields.
- Share the records used in merge fields to the guest profile from Sharing Settings in Salesforce Setup.
- Request body for POST
-
- JSON example
-
{ "languageCode": "en", "surveyDeveloperName": "sample_survey", "invitationSettings" : { "recipientId": "003RM000008DecmYAC", "collectAnonymousResponse" : false, "invitationExpirationDate":"2023-07-31T21:32:54Z" } }
- Properties
-
Name Type Description Required or Optional Available Version invitationSettings Survey Invitation Settings Input Invitation settings of the survey. Required v1 languageCode String Code of the language to get the survey page or question details. Optional v1 surveyDeveloperName String Name of the survey. Required v1 recipientEngagementContext Map<String, String> Engagement context settings for a recipient of the survey. Optional v1 relatedRecordIds String[] IDs of the records that are related to the survey. Optional v1 staticMergeFields Map<String, String> Map of static merge field values. Optional v1
- Response body for POST
- Survey Description Output
- Request body for PATCH
-
- JSON example
-
Here’s an example for a single question.
{ "invitationId": "0Kixx0000004MWaCAM", "invitationUuid": "11845-39854594-3438", "surveyDeveloperName": "sample_survey", "languageCode": "en", "flowInterviewState" : "state1", "navigationAction" : "Next", "surveyPageResponses" : { "name" : "p_ff794819_c0f0_4e0d_b357_29ca1694cfc4", "questionResponses" : [ { "name": "q_113419b1_5d29_4bb9_8b10_e3fe324ae040", "questionType" : "MultiChoice", "responses" : [{"name" : "c_9775c2e5_9086_44a8_a5c9_89fdc886c99a"}, {"name" : "c_0f1f63cc_608a_4560_9d29_72b203f195f2"}] } ] } }
- Properties
-
Name Type Description Required or Optional Available Version flowInterviewState String State of the flow interview. Required v1 invitationId String ID of the survey invitation. Required v1 invitationUuid String Random ID of the survey invitation that’s generated for enhanced security. Required v1 languageCode String Code of the language to get the survey page or question details. Optional v1 navigationAction String Available navigation actions on the survey page. Possible values are:- Back—Navigate to the previous survey page.
- Next—Navigate to the next survey page.
Required v1 surveyDeveloperName String Name of the survey. Required v1 surveyPageResponses Survey Page Response Input Responses to the survey questions on a page. Required v1
- Response body for PATCH
- Survey Response Output