My code includes an Ajax call that looks like this:
var baseurl = Office.context.mailbox.restUrl;
var getMessageUrl = baseurl + "/v2.0/me/messages/" + rest_id + "?$select=SingleValueExtendedProperties&$expand=SingleValueExtendedProperties($filter=PropertyId eq 'String 0x007D')";
$.ajax({
url: getMessageUrl,
dataType: "jsonp",
headers: {
"Authorization": "Bearer " + rest_token,
"Accept": "application/json; odata.metadata=none"
},
error: function (xhr, ajaxOptions, thrownError) {
$('.resultsScore').text(xhr.statusText);
}
}).done(function (item) {
Despite my efforts, I keep encountering an error as the error function always gets triggered. When I switch to using dataType: "json", everything works smoothly. What could be causing this issue? Why does jsonp not work in this specific scenario?