ok, its really exactly the same
url: webapihost + "api/login",
type: "POST",
data: JSON.stringify({
/*
Following are the Credentials required to connect to the WebAPI server. Valiable model contains the credensial as they would be entered by an EBS user
*/
SubscriptionPassword: 'passx',
model: {
BranchID: "01",
LangID: "el-GR",
UserID: "khcadmin",
Password: "P@ssw0rd"
}
}),
contentType: "application/json; charset=utf-8",
becomes
url=webapihost + "api/login";
authorization_data=
/*
Following are the Credentials required to connect to the WebAPI server. Valiable model contains the credensial as they would be entered by an EBS user
*/
{
SubscriptionPassword: 'passx',
model: {
BranchID: "01",
LangID: "el-GR",
UserID: "khcadmin",
Password: "P@ssw0rd"
}
};
options={contentType:"application/json; charset=utf-8"}
return this.http.post(url, authorization_data, options);
on return you get an xml document with the token in it
token = result.Model.WebApiToken;
document.getElementById("token").innerText = token;