Returns a single active (published and not expired) survey that the user has permission to view, with the included (requested) questions that the user has permission to view.
Client Servlet | Server Servlet | HTTP Methods Supported | Requires Authentication |
---|---|---|---|
CRSurveyAPI | None. | GET, POST | Yes. |
Use this client-only method to retrieve all the information you need in order to present an active survey for a user to fill out, generally when you intend to submit the user's response to that survey via the submitSurvey method.
Questions that are configured to update a constituent record will contain the value that should be pre-filled for that question as part of the questionRecord. For Constituent Registration Information Questions, the value that should be pre-filled for a given field is contained as part of the questionTypeData.ConsRegData.contactInfoField for that specific field. Since this method can be used to retrieve constituent information, it can can only be called from trusted sources and requires that the caller pass an authentication token.
Implementation Tips
This method requires authentication, meaning that you must provide either an [[S86]] generated auth token in the auth parameter or a single sign on authentication token in the sso_auth_token parameter. For more information on authentication tokens, please refer to Authentication Token.
It is particularly important to understand the "Calling the API from an Insecure Page" section that Authentication Tokens page. Using the authentication token requires that the session in which the token is generated and the session in which the token is validated be the same session, otherwise the authentication check fails and you will receive a "Method Not Allowed" error.
This can happen when you obtain an authentication token for an insecure session (such as on an insecure PageBuilder page) and then make a call to getSurvey using the secure Survey API url. In order for this to work successfully, you must append the session ID to the request to the Secure URL in order to ensure that the user's authenticated session information is transferred from the insecure server to the secure server. This will allow the authentication token retrieved on the insecure server to be validated by the secure server.
If you are using PageBuilder, you can use the T2 tag to wrap the URL used to make the getSurvey call as described in the Authentication Tokens documentation and use the S86 tag to generate the authentication token.
If you cannot use the T2 tag (which is specific to pages hosted in Luminate Online), you will still need to ensure that the user's authenticated session is transferred from the insecure server to the secure server. One of the easy ways to do this is to make a call to one of the Secure Servlets in Luminate Online but use the insecure URL. For example: http://demo829.convio.net/site/AjaxHelper (replace the "demo829.convio.net" with your site's domain name). The AjaxHelper servlet is a secure servlet, so the Luminate Online system will recognize that you have requested a secure servlet using the insecure URL and will redirect you to the appropriate secure servlet on the secure url, appending the session information necessary to transfer the session.
In order for this to work, you would need to first make the insecure request to the AjaxHelper servlet and allow that request and subsequent redirect to complete successfully, which establishes and transfers the session on the insercure server to the secure server. This gives you a session on both servers that can be recognized by the system. Once that is complete, you can obtain the Authentication Token, then make your call to getSurvey using that authentication token. For one example of how to do this, see the Survey API Reference Implementation.
Captcha Questions
Original Luminate Online Captcha
For accessibility, you must provide the user with an option to switch from an image based challenge object to an audio file challenge object. The switch must include requesting a new challenge object. The following example uses the YUI Library to accomplish this:
/** * Registers a CAPTCHA question in global storage so that in the * event of any error, we can update the Captcha Image. * * Note that the way CAPTCHA works, only the last question * to be rendered will actually work. Including multiple CAPTCHA * questions in a survey serves no purpose, but it is possible. * * @param the questionRecord from the getSurveyResponse document to * be registered */ var registerCaptchaQuestion = function(question){ YAHOO.Convio.Survey.Data.captchaQuestion = question; } /** * Changes the Captcha Image for the provided question. * @param event JavaScript Event that triggered this call (generally a Click event) * @param question the captcha question to change the image for */ var changeCaptchaImage = function(event, question) { var captchaData = question.questionTypeData.captchaData; var ts = new Date().getTime(); document.getElementById('captcha_img_' + question.questionId).src=captchaData.imageSource+'?ts='+ts; YAHOO.util.Dom.removeClass(document.getElementById('captcha_img_' + question.questionId), "hidden-form"); YAHOO.util.Dom.addClass(document.getElementById('captcha_player_' + question.questionId), "hidden-form"); } /** * Resets the captcha question registered in global storage to remove any value from it's * input field and changes the image to a new image. * * Call this upon an unsuccessful attempt to submit the survey in order to reset the captcha * question for the user to answer again. */ var resetCaptchaQuestion = function(){ if(YAHOO.Convio.Survey.Utils.hasValue(YAHOO.Convio.Survey.Data.captchaQuestion)){ var inputEl = YAHOO.util.Dom.get("question_" + YAHOO.Convio.Survey.Data.captchaQuestion.questionId); inputEl.value = ""; changeCaptchaImage(null, question); } } /** * Renders a Captcha Question to the DOM as a child of the provided parentEl * * @param parentEl HTML element that this question should be appended to * @param question questionRecord for a Captcha question from the getSurveyResponse */ var renderCaptchaQuestion = function(parentEl, question) { // register the question in Global storage: registerCaptchaQuestion(question); // Create a Div to hold this question and it's components: var qDiv = document.createElement("div"); qDiv.id = "container_question_" + question.questionId; YAHOO.util.Dom.addClass(qDiv, "question-container"); // Add the question's label (Question Text) var labelDiv = document.createElement("div"); YAHOO.util.Dom.addClass(labelDiv, "question-text"); if(question.questionRequired == 'true'){ var reqElem = document.createElement("span"); YAHOO.util.Dom.addClass(reqElem, "question-required"); reqElem.appendChild(document.createTextNode('* ')); labelDiv.appendChild(reqElem); } // EXAMPLE NOTES: YAHOO.Convio.Survey.Utils.ensureArray is a utility function // to ensure that the data passed in is an array, the details of which // are not included in this example. // // questionNumber is a global variable that is incremented each time a // question is numbered. if(YAHOO.Convio.Survey.Data.Survey.isNumberQuestions == 'true' && YAHOO.Convio.Survey.Utils.ensureArray(YAHOO.Convio.Survey.Data.Survey.surveyQuestions).length > 1){ var numberDiv = document.createElement("span"); YAHOO.util.Dom.addClass(numberDiv, "question-number"); numberDiv.appendChild(document.createTextNode(questionNumber++ + ". ")); elem.appendChild(numberDiv); } // add an HTML Label Element for the input field: var labelEl = document.createElement("label"); YAHOO.util.Dom.addClass(labelEl, "question-label"); labelEl.id = "label_" + question.questionId; YAHOO.util.Dom.setAttribute(labelEl, "for", "question_" + question.questionId); labelEl.appendChild(document.createTextNode(question.questionText)); labelDiv.appendChild(labelEl); qDiv.appendChild(labelDiv); var inputDiv = document.createElement("div"); YAHOO.util.Dom.addClass(inputDiv, "question-input"); var captchaContainer = document.createElement("div"); captchaContainer.id = "captcha-input-container"; YAHOO.util.Dom.addClass(captchaContainer, "captcha-container"); var captchaInputContainer = document.createElement("div"); captchaInputContainer.id = "captcha-input"; YAHOO.util.Dom.addClass(captchaInputContainer, "captcha-input-container"); var inputEl = document.createElement("input"); inputEl.type = "text"; inputEl.id = "question_" + question.questionId; inputEl.name = "question_" + question.questionId; YAHOO.util.Dom.setAttribute(inputEl, "size", "10"); YAHOO.util.Dom.setAttribute(inputEl, "maxlength", "20"); var captchaData = question.questionTypeData.captchaData; // Create a Link that the user can click on to get an audio file for the challenge object: var audioLink = document.createElement("a"); YAHOO.util.Dom.addClass(audioLink, "captcha-question-audiolink"); YAHOO.util.Dom.setAttribute(audioLink, "href", "javascript:void(0);"); YAHOO.util.Dom.setAttribute(audioLink, "title", captchaData.audioLinkLabel); // EXAMPLE NOTE: the src of the img should be relative to point to the image // at this location; this image at this location is included by default on Luminate Online // sites. audioLink.innerHTML = "<img src='http://yourdomain.org/images/Action_buttons/accessibility.gif' alt='" + captchaData.audioLinkLabel + "'>"; // Create a link for the user to change the image if they need to var changeImageLink = document.createElement("a"); YAHOO.util.Dom.addClass(changeImageLink, "captcha-question-changeImageLink"); YAHOO.util.Dom.setAttribute(changeImageLink, "href", "javascript:void(0);"); YAHOO.util.Dom.setAttribute(changeImageLink, "title", captchaData.changeImageLabel); changeImageLink.innerHTML = captchaData.changeImageLabel; var breakTag = document.createElement("br"); captchaInputContainer.appendChild(inputEl); captchaInputContainer.appendChild(audioLink); captchaInputContainer.appendChild(breakTag); captchaInputContainer.appendChild(changeImageLink); var captchaImageContainer = document.createElement("div"); captchaImageContainer.id = "captcha-image"; YAHOO.util.Dom.addClass(captchaImageContainer, "captcha-image-container"); var captchaPlayer = document.createElement("div"); captchaPlayer.id = "captcha_player_" + question.questionId; var captchaImage = document.createElement("img"); captchaImage.id = "captcha_img_" + question.questionId; YAHOO.util.Dom.setAttribute(captchaImage, "src", captchaData.imageSource); YAHOO.util.Dom.setAttribute(captchaImage, "alt", "Captcha Image"); captchaImageContainer.appendChild(captchaPlayer); captchaImageContainer.appendChild(captchaImage); captchaContainer.appendChild(captchaInputContainer); captchaContainer.appendChild(captchaImageContainer); inputDiv.appendChild(captchaContainer); qDiv.appendChild(inputDiv); parentEl.appendChild(qDiv); // Add Listeners to manage Captcha interactions: YAHOO.util.Event.addListener(changeImageLink, "click", changeCaptchaImage, question); /** * This function is responsible for retrieving a new audio file challenge object. * It presents the audio file as either a Windows Media Player or Quicktime object * based on the user's browser. */ var audio_challenge = function() { var ts = new Date().getTime(); YAHOO.util.Dom.addClass(document.getElementById('captcha_img_' + question.questionId), "hidden-form"); YAHOO.util.Dom.removeClass(document.getElementById('captcha_player_' + question.questionId), "hidden-form"); // If user agent is Safari or Opera, then use QuickTime, otherwise use Windows Media Player if(YAHOO.env.ua.webkit > 0 || YAHOO.env.ua.opera > 0) { document.getElementById('captcha_player_' + question.questionId).innerHTML = '<OBJECT ' + 'CLASSID="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" ' + 'WIDTH="160" HEIGHT="50" ' + 'CODEBASE="http://www.apple.com/qtactivex/qtplugin.cab">' + '<param name="SRC" value="' + captchaData.audioLink + '&ts=' + ts + '" /> ' + '<PARAM name="AUTOPLAY" VALUE="true">' + '<PARAM name="CONTROLLER" VALUE="false">' + '<PARAM name="VOLUME" VALUE="100">' + '<PARAM name="ENABLEJAVASCRIPT" VALUE="true">' + '<PARAM name="TYPE" VALUE="audio/wav">' + '<embed classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"' + 'name="sound"' + 'id="sound"' + 'src="' + captchaData.audioLink + '&ts=' + ts + '"' + 'pluginspage="http://www.apple.com/quicktime/download/"' + 'volume="100"' + 'enablejavascript="true" ' + 'type="audio/wav" ' + 'height="50" ' + 'width="160"' + 'autostart="true"' + '> </embed>' + '</OBJECT>'; } else { document.getElementById('captcha_player_' + question.questionId).innerHTML = '<object height="50" width="160" classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95" ' + 'codebase="https://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" ' + 'standby="Loading Microsoft Windows Media Player components..." ' + 'type="application/x-oleobject" align="middle"> ' + '<param name="FileName" value="' + captchaData.audioLink + '&ts=' + ts + '" /> ' + '<param name="AutoStart" value="True" /> ' + '<param name="ShowStatusBar" value="True" /> ' + '<param name="ShowPositionControls" value="False"> ' + '<param name="Volume" value="1"> ' + '<param name="Mute" value="False"> ' + '<param name="DefaultFrame" value="mainFrame" />' + '<embed id="captcha_embed_"' + question.questionId + ' type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" width="160" height="50" showstatusbar="true" src="' + captchaData.audioLink + '&ts=' + ts + '"></embed>' + '<br />' + '<a href="' + captchaData.audioLink + '&ts=' + ts + '" target="_blank" title="' + captchaData.newWindowLabel +'">' + captchaData.standAlonePlayerLabel + '</a>' + '</object>'; } } YAHOO.util.Event.addListener(audioLink, "click", audio_challenge); };
reCAPTCHA v3
reCAPTCHA v3 is a completely seamless Captcha implementation which
scores the probabilty that the end user is a human based on their interactions
with their web browser and your site. Most of the implementation is handled
automatically by the reCAPTCHA v3 library, as covered in
You must call the Google reCAPTCHA code when the survey is submitted and
include the resulting token in the subsequent API call
to
Luminate Online provides a public key to be used when including and calling the
reCAPTCHA v3 library. This key is returned in the
<![CDATA[ <surveyQuestions>Caption is not displayed with reCAPTCHA v3. 2 0 0 1001 1 1001 Captcha false true ]]> 8LGC8XlVBCBCADEopD_X353jNNoQQ551XyLmDpPC
The publicKey could be extracted with the following code example:
<![CDATA[ var recaptchaKey; $.ajax({ url: "https://secure2.convio.net/organization/site/CRSurveyAPI", method: "POST", data: 'method=getSurvey&v=1.0&api_key=' + apiKey + '&survey_id=1001&sso_auth_token=' + ssoToken, success: function( result ) { recaptchaKey = $(result).find('recaptchaData publicKey').text() } }); ]]>
You could then load the reCAPTCHA v3 library using Jquery:
<![CDATA[ $.getScript( "https://www.google.com/recaptcha/api.js?render=" + recaptchaKey ); ]]>
On form submission you must then include the Captcha token as the answer to the Captcha question. For instance:
<![CDATA[ grecaptcha.ready(function() { grecaptcha.execute(recaptchaKey, {action: 'submit'}).then(function(token) { $.ajax({ url: "https://secure2.convio.net/organization/site/CRSurveyAPI", method: "POST", data: 'method=submitSurvey&v=1.0&api_key=' + apiKey + ' &survey_id=1001&question_1000=' + response + '&question_1001=' + encodeURIComponent(token) + '&sso_auth_token=' + ssoToken, success: function( result ) { // Handle form success here. } } }); }); } ]]>
See topic Common Parameters.
Required. The ID of the survey you are accessing.
Type xsd:nonNegativeInteger.
Optional. You must provide either this parameter or the sso_auth_token parameter. If using this parameter, you must specify an auth token generated by an embedded [[S86]] session tag in a Luminate Online web page.
Optional. You must provide either this parameter or the auth parameter. If using this parameter, you must specify a valid session authentication token returned by login, authenticateUser, or getSingleSignOnToken.
See topic HTTP Status Codes.
XML response<?xml version="1.0" encoding="UTF-8"?> <getSurveyResponse xsi:schemaLocation="http://convio.com/crm/v1.0 http://service.convio.net/xmlschema/crm.public.v1.xsd" xmlns="http://convio.com/crm/v1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <survey> <surveyId>1001</surveyId> <surveyName>New User Survey</surveyName> <viewSecurityCategory> <id>1</id> <label>General</label> </viewSecurityCategory> <reportSecurityCategory> <id>2</id> <label>Administrators Only</label> </reportSecurityCategory> <surveyIntroduction>Welcome to our site! Please take a few moments to tell us about your experience:</surveyIntroduction> <resetButtonLabel>Clear Response</resetButtonLabel> <skipButtonLabel>No, Thanks</skipButtonLabel> <submitButtonLabel>Tell us</submitButtonLabel> <isAllowMultipleSubmission>false</isAllowMultipleSubmission> <isSecureSurvey>false</isSecureSurvey> <isNumberQuestions>true</isNumberQuestions> <submitSurveyUrl>http://www.yourdomain.org/site/PageServer?pagename=thank_you</submitSurveyUrl> <cancelSurveyUrl>http://www.yourdomain.org/site/PageServer</cancelSurveyUrl> <state>PUBLISHED</state> <publishedDate>2016-02-01T09:43:44.934-06:00</publishedDate> <stopDate>2021-02-01T09:43:44.934-06:00</stopDate> <surveyQuestions> <questionText>Tell us about yourself:</questionText> <questionOrderNumber>1</questionOrderNumber> <questionMinResponses>0</questionMinResponses> <questionMaxResponses>0</questionMaxResponses> <questionId>1001</questionId> <categoryId>1</categoryId> <surveyInstanceId>1001</surveyInstanceId> <questionType>ConsQuestion</questionType> <questionRequired>true</questionRequired> <questionTypeData> <consRegInfoData> <contactInfoField> <fieldName>cons_title</fieldName> <label>Title</label> <fieldStatus>REQUESTED</fieldStatus> <fieldOptionValues> <label/> <value/> </fieldOptionValues> <fieldOptionValues> <label>Mr.</label> <value>Mr.</value> </fieldOptionValues> <fieldOptionValues> <label>Ms.</label> <value>Ms.</value> </fieldOptionValues> <fieldOptionValues> <label>Mrs.</label> <value>Mrs.</value> </fieldOptionValues> <fieldOptionValues> <label>Miss</label> <value>Miss</value> </fieldOptionValues> <fieldOptionValues> <label>Dr.</label> <value>Dr.</value> </fieldOptionValues> </contactInfoField> <contactInfoField> <fieldName>cons_first_name</fieldName> <label>First</label> <fieldStatus>REQUIRED</fieldStatus> <prefillValue>J.</prefillValue> </contactInfoField> <contactInfoField> <fieldName>cons_last_name</fieldName> <label>Last</label> <fieldStatus>REQUIRED</fieldStatus> <prefillValue>Constituent</prefillValue> </contactInfoField> <contactInfoField> <fieldName>cons_email</fieldName> <label>Email:</label> <fieldStatus>REQUIRED</fieldStatus> </contactInfoField> <email_auto_opt_in_text xsi:nil="true"/> <full_name_row_label>Name:</full_name_row_label> <city_state_zip_row_label/> <layout>STANDARD</layout> <loginPrompt>NONE</loginPrompt> <passwordComponent> <instructions>Please enter a user name and password for logging in when you return. You can use this password to update your information or receive personalized content.</instructions> <userName> <fieldName>cons_user_name</fieldName> <label>Username:</label> <fieldStatus>REQUIRED</fieldStatus> <minLength>5</minLength> <maxLength>60</maxLength> </userName> <userNameHint>5 to 60 characters</userNameHint> <password> <fieldName>cons_password</fieldName> <label>Password:</label> <fieldStatus>REQUIRED</fieldStatus> <minLength>5</minLength> <maxLength>20</maxLength> </password> <passwordHint>5 to 20 characters</passwordHint> <verifyPassword> <fieldName>cons_rep_password</fieldName> <label>Repeat Password:</label> <fieldStatus>REQUIRED</fieldStatus> <minLength>5</minLength> <maxLength>20</maxLength> </verifyPassword> </passwordComponent> <rememberMe> <fieldName>s_rememberMe</fieldName> <label>Remember me.</label> <checked>true</checked> </rememberMe> </consRegInfoData> </questionTypeData> </surveyQuestions> <surveyQuestions> <questionText>We appreciate you taking the time to tell us about your experience with our site.</questionText> <questionOrderNumber>2</questionOrderNumber> <questionMinResponses>0</questionMinResponses> <questionMaxResponses>0</questionMaxResponses> <questionId>1002</questionId> <categoryId>1</categoryId> <surveyInstanceId>1001</surveyInstanceId> <questionType>Caption</questionType> <questionRequired>false</questionRequired> </surveyQuestions> <surveyQuestions> <questionText>Why did you visit our website today?</questionText> <questionOrderNumber>3</questionOrderNumber> <questionMinResponses>0</questionMinResponses> <questionMaxResponses>0</questionMaxResponses> <questionId>1003</questionId> <categoryId>1</categoryId> <surveyInstanceId>1001</surveyInstanceId> <questionType>ComboChoice</questionType> <questionRequired>true</questionRequired> <questionTypeData> <surveyQuestionData> <availableAnswer> <label>Curious about organization</label> <value>Curious about organization</value> </availableAnswer> <availableAnswer> <label>Needed information</label> <value>Needed information</value> </availableAnswer> <availableAnswer> <label>Wanted to take action</label> <value>Wanted to take action</value> </availableAnswer> <availableAnswer> <label>Referred by friend/colleague</label> <value>Referred by friend/colleague</value> </availableAnswer> <availableAnswer> <label>Wanted to donate</label> <value>Wanted to donate</value> </availableAnswer> <availableAnswer> <label>Seeking to participate in some way</label> <value>Seeking to participate in some way</value> </availableAnswer> </surveyQuestionData> </questionTypeData> </surveyQuestions> <surveyQuestions> <questionText>Have you interacted with this organization previously to visiting this website today?</questionText> <questionOrderNumber>4</questionOrderNumber> <questionMinResponses>0</questionMinResponses> <questionMaxResponses>0</questionMaxResponses> <questionId>1004</questionId> <categoryId>1</categoryId> <surveyInstanceId>1001</surveyInstanceId> <questionType>MultiMulti</questionType> <questionRequired>true</questionRequired> <questionTypeData> <surveyQuestionData> <availableAnswer> <label>Yes, I have participated in the programs or received services from this organization</label> <value>Yes, I have participated in the programs or received services from this organization</value> </availableAnswer> <availableAnswer> <label>Yes, I have previously donated to this organization</label> <value>Yes, I have previously donated to this organization</value> </availableAnswer> <availableAnswer> <label>Yes, I am a paying member of this organization</label> <value>Yes, I am a paying member of this organization</value> </availableAnswer> <availableAnswer> <label>Yes, I have previously volunteered or worked with this organization</label> <value>Yes, I have previously volunteered or worked with this organization</value> </availableAnswer> <availableAnswer> <label>Yes, I have interacted in some other way</label> <value>Yes, I have interacted in some other way</value> </availableAnswer> <availableAnswer> <label>No, this is my first interaction</label> <value>No, this is my first interaction</value> </availableAnswer> </surveyQuestionData> </questionTypeData> </surveyQuestions> <surveyQuestions> <questionText>How many times have you used our website in the last month?</questionText> <questionOrderNumber>5</questionOrderNumber> <questionMinResponses>0</questionMinResponses> <questionMaxResponses>0</questionMaxResponses> <questionId>1005</questionId> <categoryId>1</categoryId> <surveyInstanceId>1001</surveyInstanceId> <questionType>NumericValue</questionType> <questionRequired>true</questionRequired> <prefillValue>5</prefillValue> </surveyQuestions> <surveyQuestions> <questionText>Was it easy to find what you were looking for on the site?</questionText> <questionOrderNumber>6</questionOrderNumber> <questionMinResponses>0</questionMinResponses> <questionMaxResponses>0</questionMaxResponses> <questionId>1006</questionId> <categoryId>1</categoryId> <surveyInstanceId>1001</surveyInstanceId> <questionType>YesNo</questionType> <questionRequired>true</questionRequired> <questionTypeData> <surveyQuestionData> <availableAnswer> <label>Yes</label> <value>Yes</value> </availableAnswer> <availableAnswer> <label>No</label> <value>No</value> </availableAnswer> </surveyQuestionData> </questionTypeData> </surveyQuestions> <surveyQuestions> <questionText>If you had difficulty finding information, what could we change to make it easier to find?</questionText> <questionOrderNumber>7</questionOrderNumber> <questionMinResponses>0</questionMinResponses> <questionMaxResponses>0</questionMaxResponses> <questionId>1007</questionId> <categoryId>1</categoryId> <surveyInstanceId>1001</surveyInstanceId> <questionType>TextValue</questionType> <questionRequired>false</questionRequired> </surveyQuestions> <surveyQuestions> <questionText>How would you rate the visual appeal of our site?</questionText> <questionOrderNumber>8</questionOrderNumber> <questionMinResponses>0</questionMinResponses> <questionMaxResponses>0</questionMaxResponses> <questionId>1008</questionId> <categoryId>1</categoryId> <surveyInstanceId>1001</surveyInstanceId> <questionType>RatingScale</questionType> <questionRequired>false</questionRequired> <questionTypeData> <surveyQuestionData> <availableAnswer> <label>Good</label> <value>2</value> </availableAnswer> <availableAnswer> <label>Excellent</label> <value>1</value> </availableAnswer> <availableAnswer> <label>Neither good nor bad</label> <value>3</value> </availableAnswer> <availableAnswer> <label>Bad</label> <value>4</value> </availableAnswer> <availableAnswer> <label>Worst</label> <value>5</value> </availableAnswer> </surveyQuestionData> </questionTypeData> </surveyQuestions> <surveyQuestions> <questionText>Which section of our site did you find the most valuable?</questionText> <questionOrderNumber>9</questionOrderNumber> <questionMinResponses>0</questionMinResponses> <questionMaxResponses>0</questionMaxResponses> <questionId>1009</questionId> <categoryId>1</categoryId> <surveyInstanceId>1001</surveyInstanceId> <questionType>MultiSingleRadio</questionType> <questionRequired>false</questionRequired> <questionTypeData> <surveyQuestionData> <availableAnswer> <label>News</label> <value>News</value> </availableAnswer> <availableAnswer> <label>Programs</label> <value>Programs</value> </availableAnswer> <availableAnswer> <label>Events</label> <value>Events</value> </availableAnswer> <availableAnswer> <label>Community</label> <value>Community</value> </availableAnswer> <availableAnswer> <label>About Us</label> <value>About Us</value> </availableAnswer> </surveyQuestionData> </questionTypeData> </surveyQuestions> <surveyQuestions> <questionText>If you could add a section to our site, what would it be?</questionText> <questionOrderNumber>10</questionOrderNumber> <questionMinResponses>0</questionMinResponses> <questionMaxResponses>0</questionMaxResponses> <questionId>1010</questionId> <categoryId>1</categoryId> <surveyInstanceId>1001</surveyInstanceId> <questionType>ShortTextValue</questionType> <questionRequired>false</questionRequired> <prefillValue>Daily Funnies</prefillValue> </surveyQuestions> <surveyQuestions> <questionText>What information would you like to have included in that section?</questionText> <questionOrderNumber>11</questionOrderNumber> <questionMinResponses>0</questionMinResponses> <questionMaxResponses>0</questionMaxResponses> <questionId>1011</questionId> <categoryId>1</categoryId> <surveyInstanceId>1001</surveyInstanceId> <questionType>LargeTextValue</questionType> <questionRequired>false</questionRequired> </surveyQuestions> <surveyQuestions> <questionText>This survey is annoying you:</questionText> <questionOrderNumber>12</questionOrderNumber> <questionMinResponses>0</questionMinResponses> <questionMaxResponses>0</questionMaxResponses> <questionId>1012</questionId> <categoryId>1</categoryId> <surveyInstanceId>1001</surveyInstanceId> <questionType>TrueFalse</questionType> <questionRequired>false</questionRequired> <questionTypeData> <surveyQuestionData> <availableAnswer> <label>True</label> <value>True</value> </availableAnswer> <availableAnswer> <label>False</label> <value>False</value> </availableAnswer> </surveyQuestionData> </questionTypeData> </surveyQuestions> <surveyQuestions> <questionText>What types of email are you interested in receiving?</questionText> <questionOrderNumber>13</questionOrderNumber> <questionMinResponses>0</questionMinResponses> <questionMaxResponses>0</questionMaxResponses> <questionId>1013</questionId> <categoryId>1</categoryId> <surveyInstanceId>1001</surveyInstanceId> <questionType>Categories</questionType> <questionRequired>false</questionRequired> <questionTypeData> <surveyQuestionData> <availableAnswer> <label>News and Information</label> <value>1013</value> <selected>true</selected> </availableAnswer> <availableAnswer> <label>Events</label> <value>1041</value> <selected>true</selected> </availableAnswer> <availableAnswer> <label>Advocacy Alerts</label> <value>2012</value> <selected>true</selected> </availableAnswer> </surveyQuestionData> </questionTypeData> </surveyQuestions> <surveyQuestions> <questionText>What would be the best day of the week to email you?</questionText> <questionOrderNumber>14</questionOrderNumber> <questionMinResponses>0</questionMinResponses> <questionMaxResponses>0</questionMaxResponses> <questionId>1014</questionId> <categoryId>1</categoryId> <surveyInstanceId>1001</surveyInstanceId> <questionType>MultiSingle</questionType> <questionRequired>true</questionRequired> <questionTypeData> <surveyQuestionData> <availableAnswer> <label>Sunday</label> <value>Sunday</value> </availableAnswer> <availableAnswer> <label>Monday</label> <value>Monday</value> </availableAnswer> <availableAnswer> <label>Tuesday</label> <value>Tuesday</value> </availableAnswer> <availableAnswer> <label>Wednesday</label> <value>Wednesday</value> </availableAnswer> <availableAnswer> <label>Thursday</label> <value>Thursday</value> </availableAnswer> <availableAnswer> <label>Friday</label> <value>Friday</value> </availableAnswer> <availableAnswer> <label>Saturday</label> <value>Saturday</value> </availableAnswer> </surveyQuestionData> </questionTypeData> </surveyQuestions> <surveyQuestions> <questionText>Add Interests</questionText> <questionOrderNumber>15</questionOrderNumber> <questionMinResponses>0</questionMinResponses> <questionMaxResponses>0</questionMaxResponses> <questionId>1015</questionId> <categoryId>1</categoryId> <surveyInstanceId>1001</surveyInstanceId> <questionType>HiddenInterests</questionType> <questionRequired>false</questionRequired> <questionTypeData> <surveyQuestionData> <availableAnswer> <label>Feedback</label> <value>1010</value> </availableAnswer> </surveyQuestionData> </questionTypeData> </surveyQuestions> <surveyQuestions> <questionText>What day should we deliver your free tote bag for taking this survey?</questionText> <questionOrderNumber>16</questionOrderNumber> <questionMinResponses>0</questionMinResponses> <questionMaxResponses>0</questionMaxResponses> <questionId>1016</questionId> <categoryId>1</categoryId> <surveyInstanceId>1001</surveyInstanceId> <questionType>DateQuestion</questionType> <questionRequired>false</questionRequired> </surveyQuestions> <surveyQuestions> <questionText>Blue</questionText> <questionOrderNumber>17</questionOrderNumber> <questionMinResponses>0</questionMinResponses> <questionMaxResponses>0</questionMaxResponses> <questionId>1017</questionId> <categoryId>1</categoryId> <surveyInstanceId>1001</surveyInstanceId> <questionType>HiddenTextValue</questionType> <questionRequired>false</questionRequired> </surveyQuestions> <surveyQuestions> <questionText>TRUE</questionText> <questionOrderNumber>18</questionOrderNumber> <questionMinResponses>0</questionMinResponses> <questionMaxResponses>0</questionMaxResponses> <questionId>1018</questionId> <categoryId>1</categoryId> <surveyInstanceId>1001</surveyInstanceId> <questionType>HiddenTrueFalse</questionType> <questionRequired>false</questionRequired> <questionTypeData> <surveyQuestionData> <availableAnswer> <label>True</label> <value>True</value> </availableAnswer> <availableAnswer> <label>False</label> <value>False</value> </availableAnswer> </surveyQuestionData> </questionTypeData> </surveyQuestions> <surveyQuestions> <questionText>Verify that you're human by entering the letters from the image below:</questionText> <questionOrderNumber>19</questionOrderNumber> <questionMinResponses>0</questionMinResponses> <questionMaxResponses>0</questionMaxResponses> <questionId>1019</questionId> <categoryId>1</categoryId> <surveyInstanceId>1001</surveyInstanceId> <questionType>Captcha</questionType> <questionRequired>true</questionRequired> <questionTypeData> <captchaData> <audioLink>http://www.yourdomain.org/site/Captcha?type=audio&JServSessionIdr005=adslkna787dahjy</audioLink> <imageSource>http://www.yourdomain.org/site/Captcha</imageSource> <audioLinkLabel>Visually impaired? Click here to have an audio challenge played. You will then need to enter the code that is spelled out.</audioLinkLabel> <changeImageLabel>Change image</changeImageLabel> <newWindowLabel>Opens new window.</newWindowLabel> <standAlonePlayerLabel>Click here for standalone player</standAlonePlayerLabel> </captchaData> </questionTypeData> </surveyQuestions> </survey> </getSurveyResponse>JSON response
{"getSurveyResponse":{"survey":{"stopDate":"2021-02-01T09:43:44.938-06:00","resetButtonLabel":"Clear Response","surveyIntroduction":"Welcome to our site! Please take a few moments to tell us about your experience:","state":"PUBLISHED","surveyName":"New User Survey","submitSurveyUrl":"http://www.yourdomain.org/site/PageServer?pagename=thank_you","cancelSurveyUrl":"http://www.yourdomain.org/site/PageServer","skipButtonLabel":"No, Thanks","reportSecurityCategory":{"id":"2","label":"Administrators Only"},"submitButtonLabel":"Tell us","isAllowMultipleSubmission":"false","surveyQuestions":[{"questionMaxResponses":"0","questionMinResponses":"0","questionRequired":"true","questionId":"1001","categoryId":"1","questionText":"Tell us about yourself:","questionOrderNumber":"1","questionType":"ConsQuestion","surveyInstanceId":"1001","questionTypeData":{"consRegInfoData":{"email_auto_opt_in_text":null,"rememberMe":{"label":"Remember me.","fieldName":"s_rememberMe","checked":"true"},"layout":"STANDARD","loginPrompt":"NONE","contactInfoField":[{"fieldStatus":"REQUESTED","fieldOptionValues":[{"value":{},"label":{}},{"value":"Mr.","label":"Mr."},{"value":"Ms.","label":"Ms."},{"value":"Mrs.","label":"Mrs."},{"value":"Miss","label":"Miss"},{"value":"Dr.","label":"Dr."}],"label":"Title","fieldName":"cons_title"},{"fieldStatus":"REQUIRED","label":"First","fieldName":"cons_first_name","prefillValue":"J."},{"fieldStatus":"REQUIRED","label":"Last","fieldName":"cons_last_name","prefillValue":"Constituent"},{"fieldStatus":"REQUIRED","label":"Email:","fieldName":"cons_email"}],"passwordComponent":{"userNameHint":"5 to 60 characters","passwordHint":"5 to 20 characters","instructions":"Please enter a user name and password for logging in when you return. You can use this password to update your information or receive personalized content.","userName":{"fieldStatus":"REQUIRED","maxLength":"60","minLength":"5","label":"Username:","fieldName":"cons_user_name"},"password":{"fieldStatus":"REQUIRED","maxLength":"20","minLength":"5","label":"Password:","fieldName":"cons_password"},"verifyPassword":{"fieldStatus":"REQUIRED","maxLength":"20","minLength":"5","label":"Repeat Password:","fieldName":"cons_rep_password"}},"full_name_row_label":"Name:","city_state_zip_row_label":{}}}},{"questionMaxResponses":"0","questionMinResponses":"0","questionRequired":"false","questionId":"1002","categoryId":"1","questionText":"We appreciate you taking the time to tell us about your experience with our site.","questionOrderNumber":"2","questionType":"Caption","surveyInstanceId":"1001"},{"questionMaxResponses":"0","questionMinResponses":"0","questionRequired":"true","questionId":"1003","categoryId":"1","questionText":"Why did you visit our website today?","questionOrderNumber":"3","questionType":"ComboChoice","surveyInstanceId":"1001","questionTypeData":{"surveyQuestionData":{"availableAnswer":[{"value":"Curious about organization","label":"Curious about organization"},{"value":"Needed information","label":"Needed information"},{"value":"Wanted to take action","label":"Wanted to take action"},{"value":"Referred by friend/colleague","label":"Referred by friend/colleague"},{"value":"Wanted to donate","label":"Wanted to donate"},{"value":"Seeking to participate in some way","label":"Seeking to participate in some way"}]}}},{"questionMaxResponses":"0","questionMinResponses":"0","questionRequired":"true","questionId":"1004","categoryId":"1","questionText":"Have you interacted with this organization previously to visiting this website today?","questionOrderNumber":"4","questionType":"MultiMulti","surveyInstanceId":"1001","questionTypeData":{"surveyQuestionData":{"availableAnswer":[{"value":"Yes, I have participated in the programs or received services from this organization","label":"Yes, I have participated in the programs or received services from this organization"},{"value":"Yes, I have previously donated to this organization","label":"Yes, I have previously donated to this organization"},{"value":"Yes, I am a paying member of this organization","label":"Yes, I am a paying member of this organization"},{"value":"Yes, I have previously volunteered or worked with this organization","label":"Yes, I have previously volunteered or worked with this organization"},{"value":"Yes, I have interacted in some other way","label":"Yes, I have interacted in some other way"},{"value":"No, this is my first interaction","label":"No, this is my first interaction"}]}}},{"questionMaxResponses":"0","questionMinResponses":"0","questionRequired":"true","questionId":"1005","categoryId":"1","questionText":"How many times have you used our website in the last month?","questionOrderNumber":"5","questionType":"NumericValue","surveyInstanceId":"1001","prefillValue":"5"},{"questionMaxResponses":"0","questionMinResponses":"0","questionRequired":"true","questionId":"1006","categoryId":"1","questionText":"Was it easy to find what you were looking for on the site?","questionOrderNumber":"6","questionType":"YesNo","surveyInstanceId":"1001","questionTypeData":{"surveyQuestionData":{"availableAnswer":[{"value":"Yes","label":"Yes"},{"value":"No","label":"No"}]}}},{"questionMaxResponses":"0","questionMinResponses":"0","questionRequired":"false","questionId":"1007","categoryId":"1","questionText":"If you had difficulty finding information, what could we change to make it easier to find?","questionOrderNumber":"7","questionType":"TextValue","surveyInstanceId":"1001"},{"questionMaxResponses":"0","questionMinResponses":"0","questionRequired":"false","questionId":"1008","categoryId":"1","questionText":"How would you rate the visual appeal of our site?","questionOrderNumber":"8","questionType":"RatingScale","surveyInstanceId":"1001","questionTypeData":{"surveyQuestionData":{"availableAnswer":[{"value":"2","label":"Good"},{"value":"1","label":"Excellent"},{"value":"3","label":"Neither good nor bad"},{"value":"4","label":"Bad"},{"value":"5","label":"Worst"}]}}},{"questionMaxResponses":"0","questionMinResponses":"0","questionRequired":"false","questionId":"1009","categoryId":"1","questionText":"Which section of our site did you find the most valuable?","questionOrderNumber":"9","questionType":"MultiSingleRadio","surveyInstanceId":"1001","questionTypeData":{"surveyQuestionData":{"availableAnswer":[{"value":"News","label":"News"},{"value":"Programs","label":"Programs"},{"value":"Events","label":"Events"},{"value":"Community","label":"Community"},{"value":"About Us","label":"About Us"}]}}},{"questionMaxResponses":"0","questionMinResponses":"0","questionRequired":"false","questionId":"1010","categoryId":"1","questionText":"If you could add a section to our site, what would it be?","questionOrderNumber":"10","questionType":"ShortTextValue","surveyInstanceId":"1001","prefillValue":"Daily Funnies"},{"questionMaxResponses":"0","questionMinResponses":"0","questionRequired":"false","questionId":"1011","categoryId":"1","questionText":"What information would you like to have included in that section?","questionOrderNumber":"11","questionType":"LargeTextValue","surveyInstanceId":"1001"},{"questionMaxResponses":"0","questionMinResponses":"0","questionRequired":"false","questionId":"1012","categoryId":"1","questionText":"This survey is annoying you:","questionOrderNumber":"12","questionType":"TrueFalse","surveyInstanceId":"1001","questionTypeData":{"surveyQuestionData":{"availableAnswer":[{"value":"True","label":"True"},{"value":"False","label":"False"}]}}},{"questionMaxResponses":"0","questionMinResponses":"0","questionRequired":"false","questionId":"1013","categoryId":"1","questionText":"What types of email are you interested in receiving?","questionOrderNumber":"13","questionType":"Categories","surveyInstanceId":"1001","questionTypeData":{"surveyQuestionData":{"availableAnswer":[{"selected":"true","value":"1013","label":"News and Information"},{"selected":"true","value":"1041","label":"Events"},{"selected":"true","value":"2012","label":"Advocacy Alerts"}]}}},{"questionMaxResponses":"0","questionMinResponses":"0","questionRequired":"true","questionId":"1014","categoryId":"1","questionText":"What would be the best day of the week to email you?","questionOrderNumber":"14","questionType":"MultiSingle","surveyInstanceId":"1001","questionTypeData":{"surveyQuestionData":{"availableAnswer":[{"value":"Sunday","label":"Sunday"},{"value":"Monday","label":"Monday"},{"value":"Tuesday","label":"Tuesday"},{"value":"Wednesday","label":"Wednesday"},{"value":"Thursday","label":"Thursday"},{"value":"Friday","label":"Friday"},{"value":"Saturday","label":"Saturday"}]}}},{"questionMaxResponses":"0","questionMinResponses":"0","questionRequired":"false","questionId":"1015","categoryId":"1","questionText":"Add Interests","questionOrderNumber":"15","questionType":"HiddenInterests","surveyInstanceId":"1001","questionTypeData":{"surveyQuestionData":{"availableAnswer":{"value":"1010","label":"Feedback"}}}},{"questionMaxResponses":"0","questionMinResponses":"0","questionRequired":"false","questionId":"1016","categoryId":"1","questionText":"What day should we deliver your free tote bag for taking this survey?","questionOrderNumber":"16","questionType":"DateQuestion","surveyInstanceId":"1001"},{"questionMaxResponses":"0","questionMinResponses":"0","questionRequired":"false","questionId":"1017","categoryId":"1","questionText":"Blue","questionOrderNumber":"17","questionType":"HiddenTextValue","surveyInstanceId":"1001"},{"questionMaxResponses":"0","questionMinResponses":"0","questionRequired":"false","questionId":"1018","categoryId":"1","questionText":"TRUE","questionOrderNumber":"18","questionType":"HiddenTrueFalse","surveyInstanceId":"1001","questionTypeData":{"surveyQuestionData":{"availableAnswer":[{"value":"True","label":"True"},{"value":"False","label":"False"}]}}},{"questionMaxResponses":"0","questionMinResponses":"0","questionRequired":"true","questionId":"1019","categoryId":"1","questionText":"Verify that you're human by entering the letters from the image below:","questionOrderNumber":"19","questionType":"Captcha","surveyInstanceId":"1001","questionTypeData":{"captchaData":{"newWindowLabel":"Opens new window.","changeImageLabel":"Change image","audioLinkLabel":"Visually impaired? Click here to have an audio challenge played. You will then need to enter the code that is spelled out.","imageSource":"http://www.yourdomain.org/site/Captcha","audioLink":"http://www.yourdomain.org/site/Captcha?type=audio&JServSessionIdr005=adslkna787dahjy","standAlonePlayerLabel":"Click here for standalone player"}}}],"isNumberQuestions":"true","publishedDate":"2016-02-01T09:43:44.938-06:00","viewSecurityCategory":{"id":"1","label":"General"},"surveyId":"1001","isSecureSurvey":"false"}}}
To retrieve the survey with the survey_id=1021:
https://demo-secure.convio.net/demo829/site/CRSurveyAPI?method=getSurvey&v=1.0&api_key=MyAPIKey&survey_id=1021
To embed a form on an insecure PageBuilder page that allows the user to request a specific survey:
<form action="[[T2:https://[[S29:SECURE_DOMAIN]][[S29:SECURE_PATH]]CRSurveyAPI]]" method="post"> <input name="api_key" type="hidden" value="MyAPIKey" /> <input name="v" type="hidden" value="1.0" /> <input name="method" type="hidden" value="getSurvey" /> [[S86]] <label for="survey_id">Survey ID: </label> <input name="survey_id" type="text" value="1001" size="15" maxlength="6" /> <input name="Submit" type="submit" value="Submit" /> </form>