Community Groups are officially here!
We've released Groups, a new feature that enables us to connect community members of similar industries and interests in a shared, private space. You can check out all of the details here, including information about who can join, how to join, and what Groups are currently offered. Please leave your feedback through this Community Groups Feedback Survey.

Sending embedded data over GET request in JSON format

Julesmakr
Julesmakr Community Member Qubie ✭
edited February 2020 in Integrations

Hi all,

I have a simple HTTP request I want to make using embedded data. I am using software which is adhering to a certain format when using HTTP request. A simple example would be as follows:

http://host:8080/getaction/exp_id?key=unique_key&context={"user":unique_user_id}

I would like to put in an embedded data field with the unique user ID that is in Qualtrics. I've tried many options, but for some reason Qualtrics will not send the embedded data field. Let's say I've created an embedded data field user before adding the web service in the survey flow. Then, intuitively I would think that the following should work:

http://HOST:8080/getaction/exp_id?key=unique_key&context={"user":'${e://Field/user}'}

I've tried using single quotes, double quotes, no quotes. I've also tried adding it as a query parameter, but unfortunately didn't have success yet.

Can anyone give me a pointer to solve this?

Tagged:

Best Answers

  • TomG
    TomG Raleigh, NCCommunity Member, Qualtrics Brand Admin Wizard ✭✭✭✭✭
    Accepted Answer

    Two things:
    1. Use query parameters so they get url encoded
    2. Put the user field in double quotes

    Your example would look like:

  • TomG
    TomG Raleigh, NCCommunity Member, Qualtrics Brand Admin Wizard ✭✭✭✭✭
    Accepted Answer

    @Julesmakr said:
    Thanks for your reply. I have also tried this, but the response I get from my webservice is:

    {"action": {"treatment": "3"}, "context": {"user": "${e://Field/user}"}}

    But I should be getting:

    {"action": {"treatment": "3", "response":"worked!"}, "context": {"user": "try_out"}}

    So the encoding of the URL does not take the embedded data into account it seems?

    Piped strings don't get replaced when click the Test button. You have to actually take the survey to test it.

Answers

  • Julesmakr
    Julesmakr Community Member Qubie ✭

    Thanks for your reply. I have also tried this, but the response I get from my webservice is:

    {"action": {"treatment": "3"}, "context": {"user": "${e://Field/user}"}}

    But I should be getting:

    {"action": {"treatment": "3", "response":"worked!"}, "context": {"user": "try_out"}}

    So the encoding of the URL does not take the embedded data into account it seems?

  • Julesmakr
    Julesmakr Community Member Qubie ✭

    @TomG said:

    @Julesmakr said:
    Thanks for your reply. I have also tried this, but the response I get from my webservice is:

    {"action": {"treatment": "3"}, "context": {"user": "${e://Field/user}"}}

    But I should be getting:

    {"action": {"treatment": "3", "response":"worked!"}, "context": {"user": "try_out"}}

    So the encoding of the URL does not take the embedded data into account it seems?

    Piped strings don't get replaced when click the Test button. You have to actually take the survey to test it.

    Right, that makes sense! It works now, many thanks! :smile: