web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Unanswered

Issue due to header in ajax script

(0) ShareShare
ReportReport
Posted on by 135

Hello Folks,

I'm facing error while passing the mandatory header in the ajaxcall using javascript.

When i exclude the header i get headers missing error if i include the header i get 500 internal server error in the logs (errors": [{"message": "Unable to match incoming request to an operation.", "reason": "OperationNotFound", "section": "backend", "source": "configuration"}]})

Any suggestions? or any other way to call the Async API url?

if (typeof ($) === 'undefined') {
$ = parent.$;
jQuery = parent.jQuery;
}

function submit(selectedIds) {
if (selectedIds != null && selectedIds != "") {
Xrm.WebApi.retrieveRecord("profile", selectedIds, "?$select=name").then(
function success(result) {
var name=result.name;
var urlPath = "AZUREAPIURL" + imsi ;
var subscriptionKey = "XXXXXXXXXXXXX";
var NewDate=new Date().toUTCString();
var xRequestID = generateUUID();
$.ajax({
headers: {
"X-Request-ID" : xRequestID,
"Date": NewDate
},
url: urlPath + "?api-key=" + subscriptionKey,
type: "GET",
dataType: "json",
async: true,
crossDomain: true,
success: function (data, textStatus, xhr) {
return JSHelper.toJson(data);
},
error: function () {}
})
.done(function (data, status, jqxhr) {});
},
function (error) {}
);
}
}

Regards,

Hima

I have the same question (0)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 70 Super User 2025 Season 2

#2
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 33 Most Valuable Professional

#3
Daniyal Khaleel Profile Picture

Daniyal Khaleel 32 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans