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.

Salesforce Feedback Management Business API performance can be impacted if a POST request exceeds 3600 calls per minute and if a PATCH request exceeds 1800 calls per minute at the organization level.

Note

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 

1/<MyDomainURL>/<AppPrefix>/survey-response

Resource Example 

1https://yourInstance.salesforce-scrt.com​/surveys/v1/survey-response

Available Version 

v1

Requires Chatter 

No

HTTP Methods 

PATCH, POST

The HTTP header request format only accepts Content-Type: application/json.

Note

Special Access Rules 

The Feedback Management - Growth license is required to use this resource.

Ensure the survey is shared to the guest profile from Sharing Settings in Salesforce Setup.

Note

Authorization 

Use the bearer token from the accessToken request.

1Authorization: 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.

See Also

Request Body for POST 

Root XML tag 

<SurveyDescriptionInput>

JSON Example 

1{
2    "languageCode": "en",
3    "surveyDeveloperName": "sample_survey",
4    "invitationSettings" : {
5      "recipientId": "003RM000008DecmYAC",
6      "collectAnonymousResponse" : false,
7      "invitationExpirationDate":"2023-07-31T21:32:54Z"
8    }
9}

Properties 

NameTypeDescriptionRequired or OptionalAvailable Version
invitation​SettingsSurvey Invitation Settings InputInvitation settings of the survey.Requiredv1
languageCodeStringCode of the language to get the survey page or question details. Ensure the survey is shared to the participant in this specified language.Optionalv1
survey​Developer​NameStringName of the survey.Requiredv1
recipient​Engagement​ContextMap<String, String>Engagement context settings for a recipient of the survey.Optionalv1
related​RecordIdsString[]IDs of the records that are related to the survey.Optionalv1
static​MergeFieldsMap<String, String>Map of static merge field values.Optionalv1

Response Body for POST 

Survey Description Output

Request Body for PATCH 

Root XML tag 

<SurveyResponseInput>

JSON Example 

Here’s an example for a single question.

1{
2 "invitationId": "0Kixx0000004MWaCAM",
3 "invitationUuid": "11845-39854594-3438",
4 "surveyDeveloperName": "sample_survey",
5 "languageCode": "en",
6 "flowInterviewState" : "state1",
7 "navigationAction" : "Next",
8 "surveyPageResponses" : {
9        "name" :  "p_ff794819_c0f0_4e0d_b357_29ca1694cfc4",
10        "questionResponses" : [
11            {
12                "name": "q_113419b1_5d29_4bb9_8b10_e3fe324ae040",
13                "questionType" : "MultiChoice",
14                "responses" : [{"name" : "c_9775c2e5_9086_44a8_a5c9_89fdc886c99a"}, 
15                                {"name" : "c_0f1f63cc_608a_4560_9d29_72b203f195f2"}]
16            }
17         ]
18   }
19}

Properties 

NameTypeDescriptionRequired or OptionalAvailable Version
flowInterview​StateStringState of the flow interview.Requiredv1
invitationIdStringID of the survey invitation.Requiredv1
invitationUuidStringRandom ID of the survey invitation that’s generated for enhanced security.Requiredv1
languageCodeStringCode of the language to get the survey page or question details. Ensure the survey is shared to the participant in this specified language.Optionalv1
navigation​ActionStringAvailable navigation actions on the survey page. Possible values are:
  • Back—Navigate to the previous survey page.
  • Next—Navigate to the next survey page.
Requiredv1
survey​Developer​NameStringName of the survey.Requiredv1
surveyPage​ResponsesSurvey Page Response InputResponses to the survey questions on a page.Requiredv1

Response Body for PATCH 

Survey Response Output