Calling Orchestration Api through jquery



i am trying to explore for calling through Orchestration Api through jquery from visual studio

Even after passing the required data to authenticate request is showing username and password not provided

type: “POST”,
url: “https://xxx/api/account/authenticate”,
data:{ “usernameOrEmailAddress” : “xx”,
“password” : “xx”} ,
success: function (response) { alert(response); alert(response.LicenseKey); alert(“sucess”) },
failure: function (response1) {



Any direction on this will be very helpfull

Thank you


Hi Husein,

I see two issues in your code:

  1. the URL is wrong, it should be something like “
  2. your request is missing the tenant parameter in data, “tenancyName”: “xx”, or “tenancyName”: “default”



Than you for your input but
i was just pointing to local orchestration as mentioned in the api guide

Note: All examples have been built using the Orchestrator address. Please use your own Orchestrator address

After entering tenancy as parameter it seems to be working as fiddler is showing success with “result” attribute showing the key returned by the api

But cannot access the result with jquery
var data = {};

    // throw some data into the object
    //  data.address = '123 Main Street';
    // = 'Orlando';
    //data.state = 'FL';

    data.tenancyName = "xxx",

data.usernameOrEmailAddress = “xxx”,
data.password = “xxx”

    // convert the object into a json string
    var data_json = JSON.stringify(data);

var result = ‘’;
// alert(sendInfo);
//json object passed
type: “POST”,
url: “xxx/api/account/authenticate”,
data: JSON.stringify(data_json),
dataType: “json”,
contentType: “application/json; charset=utf-8”,
success: function (data) { result = data; alert(result); },
failure: function () {



    alert('the value:' +result);

is not returning any value



The following example is working for me:

	type: "POST",
	contentType: "application/json",
	url: "",
	data: JSON.stringify({ "tenancyName":"xxx", "usernameOrEmailAddress" : "xxx","password" : "xxx"}) ,
	error: function (data) {console.log(data.responseJSON.message); console.log(data);},
	success: function(data) {console.log(data); console.log(data.result);}

Replace the Url, Tenant, Username and Password with real data and give it a try.


Actually recently it has
Strangely for me it is neither going in success or error block but in fiddler it is showing as success