I must also add that I have been able to connect with the given examples (Eli's Blogpost) and am able retrieve items/properties. I am not looking for help on how to connect, but how to get a given report applied to a given item.
I want to be able to do this via an html client. Not sure how that works either. I am able to create a client with only one function on the server. Not sure how to add more functions to it. Or do I have to create a separate .js file for each function?
aras.js file:
authenticate().then(RESTRequest);
function authenticate() {
return $.ajax({
url: "">amrndsvdap44.nidecds.com/.../token",
type: 'POST',
data: {
'grant_type': 'password',
'scope': 'Innovator',
'client_id': 'IOMApp',
'username': 'nmc5019',
'password': '673781C8150EB32ADC892B364F6BD742',
'database': 'InnNMCSolutionsMIDB-2'
},
error: function(xhr, status, error) {
var err = eval("(" + xhr.responseText + ")");
console.log(err.Message);
},
success: function(data) {}
});
}
function RESTRequest(response) {
$.ajax({
url: "">amrndsvdap44.nidecds.com/.../NMC_Customer_Motor('3DEE3351A32B48C99C634AB62AF32959')",
type: 'GET',
headers: {
"Authorization": 'Bearer ' + response.access_token
},
error: function(xhr, status, error) {
var err = eval("(" + xhr.responseText + ")");
console.log(err.Message);
},
success: function(data) {
//Do Something with results
$('.id').append(data.id);
$('.customer_name').append(data.customer_name);
$('.md_model_number').append(data.md_model_number);
}
});
}
HTML Client:
<!DOCTYPE html>
<html>
<head>
<title>Aras jQuery</title>
<script src="">ajax.googleapis.com/.../script>
<script src="aras.js"></script>
</head>
<body>
<div>
<p class="id">ID: </p>
<p class="customer_name">Customer Name: </p>
<p class="md_model_number">Model Number: </p>
</div>
</body>
</html>