Soham Shah
Soham Shah

Reputation: 571

How to use SAP AIN (Asset Intelligence Network) APIs

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.

Any help would be useful.

Upvotes: 1

Views: 771

Answers (2)

bastelflp
bastelflp

Reputation: 10086

The correct API endpoint for equipment count is: application url + /services/api/v1/ + /equipment/$count.

The application URL looks like: https://ain.xyz.hana.ondemand.com/ain (mind the included /ain) (see SAP AIN API tutorial).

The full API endpoint would look like (replace xyz with your application): https://ain.xyz.hana.ondemand.com/ain/services/api/v1/equipment/$count.

See SAP AIN API reference, version 1908 for more information. You can test this also on the SAP AIN equipment API of the SAP API Business Hub for SAP AIN.

Upvotes: 0

Soham Shah
Soham Shah

Reputation: 571

I got it working myself. I was using a wrong hostname of the API.

Upvotes: 1

Related Questions