Create Distribution through API: Subject from Library?

JoycaVJoycaV BelgiumCommunity Member Sage ✭✭✭
edited April 22 in Qualtrics API

Create Distribution through API: Subject from Library?

Hi all,

I'm creating Distributions through the API https://{{host}}/API/v3/distributions

In the "message" part, I can indicate the libraryId + messageId of the email that I want to send. This email is translated into multiple languages, so the correct respondent receives the correct email in his language.

However, I can't find how to use a library message for the email subject.


I tried looking at a GET call for a distribution that does have an email subject from the library, like

https://{{host}}/API/v3/distributions/EMD_tnd2OfwerC0uRhp?surveyId=SV_a5g21DZrTZrYtRH

For emails with a fixed subject, it returns:

        "headers": {

            "fromEmail": "xxx",

            "replyToEmail": "xxx",

            "fromName": "xxx",

            "subject": "we want to know your opinion"

        }


While for emails with a library subject, it becomes

 "headers": {

      "fromEmail": "xxx",

      "replyToEmail": "xxx",

      "fromName": "xxx",

      "subjectMessage": {

        "messageId": "MS_6ulDgLSHi2yowpT",

        "libraryId": "GR_dhuve6yo89sajOt"

      }


But when I try to use this "subjectMessage" structure in a POST call for the distributions, I get the error

            "errorMessage": "Expected param not found: subject",

I can't really seem to find something on the API guide about it... so I'm fearing it's not possible to use a library email subject?

Could anyone confirm this, or does someone know a way to do that? As I'm translating my emails, the subject should of course also be translated...

Best Answer

  • JoycaVJoycaV BelgiumCommunity Member Sage ✭✭✭
    edited April 27 Accepted Answer

    I contacted Qualtrics support about this, so if anyone ever encounters the same issue; this is the solution.

    Instead of adding a structure like

    "header": {

    "fromEmail": "[email protected]",

    "replyToEmail": "[email protected]",

    "fromName": "Test Name",   

    "subjectMessage": {

            "messageId": "MS_6ulDgLSHi2yowpT",

            "libraryId": "GR_dhuve6yo89sajOt"

          }

    },

    like it shows in a GET call,

    for the POST you can just add the messageId directly in the subject attribute, so like this:

    "header": {

    "fromEmail": "[email protected]",

    "replyToEmail": "[email protected]",

    "fromName": "Test Name",

    "subject": "MS_6ulDgLSHi2yowpT"

    },

Sign In to Comment