Survey API submission errors

Options

I'm struggling to get past 2 issues I'm having using the SurveyAPI in Luminate Online, directly in a pagebuilder page.

I've included the session identifier “[[S86]]”

My Ajax:

var APIKey = '[[S0:CONVIO_API_KEY]]';

function SubForm (){
jQuery.ajax({
url: 'https://secure3.convio.net/mycustomorg/site/CRSurveyAPI?method=submitSurvey&v=1.0&api_key=' + APIKey + '&survey_id=8991&question_8956=ThisWorks',
type: 'post',
success: function(){
alert("worked!");
}
});
}

I'm a little stumped and I'm looking for a little guidance or sample code to help get me on the right track.

Thanks so much!

Tagged:

Comments

  • Elizabeth Favre
    Elizabeth Favre Blackbaud Employee
    Fourth Anniversary Facilitator 1 Name Dropper Photogenic

    @Stephen Gouws
    Good afternoon!
    I am hoping to rule out a couple of easy fixes before diving deeper. I am guessing these are not the issue, but it's good to rule them out.

    1. Are you certain that your Luminate Online URL is a secure3 site and not a secure2 site? You can check by looking at the the URL where normally log in to Luminate Online as a site administrator. Identify your cluster by looking at the hostname in the admin URL. If you log in to secure2.convio.net, you are on cluster 2; if you log in to secure3.convio.net, you are on cluster 3.

    2. In https://secure3.convio.net/mycustomorg/site/CRSurveyAPI’ are you replacing “mycustomorg” with your URL?

    3. If those two pieces look right in your calls, the next step I would suggest is comparing your code to the guidance in LO API Cross Domain Access and Fetch.

    If you are still having trouble after that, please reach out again and I'll ask a dev to take a look at my documentation to see if something is obsolete or misleading.



  • @Stephen Gouws
    As Elizabeth mentioned, you'll want to make sure that you've got the URL details right, specifically the secure3.convio.net/mycustomorg should match the details of your website.

    Second issue in your code is that you're missing the authorization token in the AJAX request URL. The token is used by LO to verify that the submission is attached to a valid session. Easiest way to do get the token is to do a getLoginUrl request, grab the getLoginUrlResponse.token from the response, and then pass that to your submitSurvey request as an &auth= parameter.

Categories