Skip to main content
Loading...
  • Customer Experience
    Customer Experience
  • Employee Experience
    Employee Experience
  • Brand Experience
    Brand Experience
  • Product Experience
    Product Experience
  • Core XM
    Core XM
  • Design XM
    Design XM

Web Service

What's on This Page:


Was this helpful?


This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

The feedback you submit here is used only to help improve this page.

That’s great! Thank you for your feedback!

Thank you for your feedback!


About Web Services

Sometimes you may want to include more complex features in your survey. Maybe you want to pull in the top 10 headlines from a news website into your survey, or you want to automate a second survey distribution to be emailed to the respondents of a first survey exactly two hours later. A Web Service would allow you to do just that by making requests to a designated URL.

Qtip: This page contains references to Qualtrics’ API, which is a feature that requires special permission to access. If you are interested in obtaining access to this feature, please reach out to your Brand Administrator for more information.
Attention: Setting up a web service often requires advanced programming knowledge. Although our support team is happy to help with the basics of putting information into the web service, we cannot provide support on the programming aspects. You can always try asking our community of dedicated users instead.

Adding a Web Service

  1. While editing your survey, click the Survey flow icon in the left navigation bar.
    navigating to the survey flow by clicking the survey flow icon on the left navigation bar
  2. Click Add Below or Add a New Element Here.
    Add Below and Add a New element Here buttons; Web Service option in the What do you want to add? menu
  3. Select Web Service.
  4. In the URL field, paste the URL of your external Web Service.
    Field for URL in a web service followed by method

    Qtip: You can use piped text to pass survey information into your endpoint URL via query strings.
  5. Select a Method for your web service. We will explain more about the different methods in the section below.

Methods

Our web service feature allows you to choose from a series of Methods to request information from your specified URL.

Method Type Action Example
GET The web service goes to the URL and retrieves information. Retrieve information about a member of your contact list. See the Get Contact API call for more details.
POST Go to the URL and save information there. Save a message to your library.
PUT Update or replace existing information. Change a username. This is one of the things you can do with the Update User call.
PATCH Update or replace existing information. Very similar to PUT. While our web Service offers this method, our API does not use PATCH calls. Modify data saved on your server.
DELETE Remove information. Delete a graphic from your library.

 

If you are using our API calls, the documentation will tell you which method to use, as indicated in the screenshot below.

Method listed next to each call in the API documentation

Parameters

There are currently three types of Parameters you can append to your request.

A Web Service with the following highlighted: Add a query parameter, Add a body parameter, and Add a custom header

  1. Query parameter: Instead of adding a query string to the end of your Web Service URL, place your query parameters here.
  2. Body parameter: This parameter is not available for GET or DELETE requests. It comes with two formatting options:
    a) application/x-www-form-urlencoded: Rather than entering your body parameters into the specified area of the Web Service, add them as a query string at the end of your specified URL.
    b) application/json: Enter your keys in Dot Notation. For example, our API call may ask you to specify a header[fromEmail]. In Dot Notation, this becomes header.fromEmail.

    Attention: Every key and value in a JSON object, as well as every element in a JSON array (including piped text), must have double quotes around it. In a body parameter, every key and value in a JSON object, as well as every element in a JSON array, must have double quotes around it.
  3. Custom header: Insert URL headers here.

If you’re using our API calls, the documentation will tell you what kind of parameters to include. The example below provides Body parameters to set.

On the API documentation, an arrow indicating Body Params

Adding Parameters to Your Web Service

Body parameters filled out in a web service

  1. Select any of the three Add a parameter to send to web service options indicated in the previous section. In the above example, we are indicating the Query Parameters.
  2. Type in the name of the parameter in the Parameter to Web Service box on the left.
  3. Type the corresponding value of the parameter in the Value box on the right.
  4. Click the plus (+) sign to the right of the parameter to add another.
  5. Click Apply when finished.

Testing Your Parameters

Once you have pasted in your URL and set up your parameters, you can test your URL to see what Fields you can pull in.

  1. Click Test URL to see which information you can pull from the external Web Service.
    Test URL button next to the URL field
  2. Select any fields that you want to use or record in your survey. The Field Name appears on the left and a corresponding Example Value appears on the right.
    Selecting fields to capture from the URL
  3. Click Add Embedded Data to add selected fields to your data.
    Qtip: You can change the embedded data names associated with the fields of your web service under the Set Embedded Data column. The embedded data names are to the left of the equals (=) sign, indicated by a green ED icon. The right side should not be altered. The names you set on the left will be the names of the fields as they appear in your data.
  4. If you select Fire and Forget, you will not save any of the data returned from the web service call. This feature is useful when you do not need to save the returned data.
    Fire and Forget option above fields; Apply on lower-right

    Qtip: Fire and Forget allows your survey to make a request to a web service without waiting for a response. This means that your respondents will be able to complete the full survey without any delay due to the web service. You may want to use this option if you have a web service request that takes a while to process, but we would recommend that you only use this feature during testing, since it will prevent embedded data from saving.
  5. When you’re done, click Apply.

Correcting TLS Errors

As of September 1, 2021, web service requests with Transport-Layer Security (TLS) errors will fail. TLS is what makes web requests over HTTPS (as opposed to plain HTTP) secure, preventing the request data from being visible to third parties and ensuring that the request is sent to the correct destination. Ignoring TLS errors effectively eliminates these security benefits; this change is an important step in our continual efforts to improve the security of the Qualtrics platform.

In order to resolve each TLS error, you need to do one of the following:

  • Fix the TLS error. Due to the nature of TLS errors, our support team cannot provide specific guidance on how to do so, but your network administrator will know how to fix the error.
  • Change the flow element web service request to be made over HTTP, not HTTPS. For example, you could change the URL “https://example.com” to “http://example.com”. If you choose to take this approach, you should also ensure that the HTTP URL doesn’t redirect to the HTTPS URL.
    Attention: Please note that this approach will cause the web service request data to be transmitted unencrypted.

You can verify that your web service element is ready for this change by using the test button next to the URL field in the flow element. Viewing the raw data in the resulting window, also shown below, should not show an error.

Dialog that opens over the survey flow and says "Select fields to include as embedded data The web service returned no fields.Click here to view the raw data." In the bottom-left corner of the dialog is a button that says "View raw data"

Attention: If you update the web service element to fix the error, you must also publish your changes to the survey. We recommend that you resolve the errors as soon as possible to avoid in-progress survey sessions using the old survey version after the deadline. If you instead resolve the error via another method (e.g., by fixing the TLS configuration on the server targeted by your web service element), publishing is not necessary.

Random Number Generator

Back when Qualtrics was first getting started, we encouraged users to use a web service calling a random number generator to create IDs for survey respondents. However, based on feedback, we found that this process can be long, difficult, and painful.

There are now much easier ways to generate random numbers for your respondents using piped text. For even more support setting up your randomized IDs and displaying them to respondents, see the assigning random IDs to respondents page.