How to create Blocks with Qualtrics API | XM Community
Skip to main content

Hello everyone (:

 

I’m trying to create blocks with the Qualtrics API but I can’t get it to work. This is my API Call:

baseUrl = "https://{0}.qualtrics.com/API/v3/survey-definitions/{1}/blocks".format(
        data_center_id, survey_id)
headers = {
"x-api-token": api_token
}
block_def ={
        "Type": "Standard",
        "Description": "block",
        "ID": f”{block_id}",
    }
response = requests.post(baseUrl, json=block_def, headers=headers)
 
And this is the response:
 
{ "meta": { "requestId": "3e02c72d-8518-4244-9e4e-0ff2f9b41be9", "httpStatus": "400 - Bad Request", "error": { "errorCode": "QMST_1", "errorMessage": "The request was invalid.", "code": "ESRV35", "message": "Invalid request. Missing or invalid parameter ID." } } }
 
I really can’t wrap my head around what’s going wrong here, I figured all the other API calls out that I had to make. Possibly I’m using the wrong block_id? I figured I’d have to make up a new one here right?
 
Cheers!
mo

@mo.rice You’re missing alot of required field in the body

 


actually it worked after I deleted the ID part as well (:

 

can be marked as solved

 

 
 

 

 


actually it worked after I deleted the ID part as well (:

can be marked as solved

@mo.rice Haha, in the document they require a bunch of field but then it work without them 🤣


Leave a Reply