I am new to web development, currently building an html web app, where I need to get data from a Qualtric survey and use it to modify my web app. I looked into Qualtric REST API here:https://survey.qualtrics.com/WRAPI/ControlPanel/docs.php#overview_2.4 and tried to follow it. I added these lines to my javascript and it always gets me error 500. Simply pasting the url to browser url bar gets me error 500, too.
Can anyone please help me on this? Thanks a lot!
$(function () {
$.ajax({
type: 'GET',
url: 'https://new.qualtrics.com/WRAPI/ControlPanel/api.php?Request=getUserInfo&User=xxxx&Token=xxxxxxxxx&Format=XML&Version=2.4',
success: function (data) {
console.log('success', data);
}
});
});
It works for me. I think it is a problem with your user name. When I use the wrong username, I get a 500 error. When I use the wrong token I get a 401 error.
This url works for me (with the correct user and token): https://new.qualtrics.com/WRAPI/ControlPanel/api.php?Version=2.4&Request=getUserInfo&User=username%40email.com&Token=XXXXX&Format=XML
Hint: If you login to Qualtrics, then go to Account/Qualtrics IDs, under API you can copy your token, then click the API Documentation link. You can then click on the Try it! link under the command you want to execute, paste in your Token, and it will build the url for you with you user name included.