I have a requirement wherein I need to call few SAP AIN (Asset Intelligence Network) APIs from a web page. I have created a web page where on a click of a button, I want to call SAP AIN API - lets say to get the count of equipment that I have setup in AIN.
The API URL Provided in the SAP AIN document is:
Application_URL/services/api/v1/equipment/$count
Lets say my AIN application URL is:
https://abcxyz.dispatcher.hana.ondemand.com/sites?hc_reset#Shell-home
I tried below approaches to form API URL:
https://abcxyz.dispatcher.hana.ondemand.com/services/api/v1/equipment/$count
-- Did not work
https://abcxyz.dispatcher.hana.ondemand.com/sites/services/api/v1/equipment/$count
-- Did not work
https://abcxyz.dispatcher.hana.ondemand.com/sites/services/api/v1/equipment/$count?content-type=application/json
-- Did not work
For all above URLs, I am getting Internal 500
error.
- So what can be the way to form SAP AIN API URL? What am I doing wrong here?
- Also how do I pass basic authentication like username and password in HttpRequest in Javascript?
Any help would be useful.