Submit question response via Survey Sessions API | XM Community
Skip to main content

I'm trying to integrate a Qualtrics survey with my chatbot platform.
The Survey Sessions API seems perfect for what I'm doing but the documentation is limited, so my understanding of this API may be incorrect. This is the idea:

  • User triggers a new survey session via the chatbot

  • Chatbot calls "new survey session" endpoint, which returns SessionID as well as the first question block which contains a single question

  • Chatbot presents the first question to the user

  • User chooses a response

  • Chatbot calls "update session" endpoint, sending the chosen response and advancing the session to the next block

  • Chatbot calls "fetch current page" endpoint, which returns the new block

  • Chatbot presents the next question

  • Etc...

Somebody please correct me if my understanding of the API behavior is incorrect, or if there is a better endpoint for this usecase.
My question is about returning the user's response in the "update session" step. The API Doc doesn't do a good job of explaining how to map responses to questions:
{
 "responses": {
  "property1": {
   "property1": {
    "selected": true,
    "text": "string"
   },
   "property2": {
    "selected": true,
    "text": "string"
   }
  },
  "property2": {
   "property1": {
    "selected": true,
    "text": "string"
   },
   "property2": {
    "selected": true,
    "text": "string"
   }
  }
}
It's not clear what property1 and property2 are refering to. Should I replace those with the question Id and choice Ids? For a single-choice question would I have to list every choice and indicate whether ornot it is "selected"? What does the "text" field refer to?
Basically, how can I send a single or multiple-answer response back to Qualtrics using this API?

Hello, how are you? I'm working on this API and i have the same doubt, it was possible for you to implement it?


Hey! So I just went through this and also found the documentation not very helpful.
Here is an example body you'd use to update your session with a response: This is a block with a MC, multiselect MC, and text question in that order.
{
  "advance": true,
  "responses": {
    "QID1": {
      "1": {
        "selected": false
      },
      "2": {
        "selected": false
      },
      "3": {
        "selected": true
      }
    },
    "QID2": {
        "1": {
        "selected": true
      },
      "2": {
        "selected": false
      },
      "3": {
        "selected": true
      } 
    },
      "QID3": "test123123"
    }
  }
}


Hi there,

@Zephye I tried to write it in that way but it’s not working.

I have a two questions survey:

QID1: Multiple choice (2 options)

QID2: Open Text

Best


Leave a Reply