on 03-30-2018 11:12 PM
Hello Experts,
I have a requirement hwerein I need to call few AIN APIs from a webpage. I have created a webpage where on a click of a button, I want to call AIN API - lets say to get the count of Equipments that I have setup in AIN.
The API URL Provided in the SAP AIN document is:
Application_URL/services/api/v1/equipment/$count
You use this API to get a count of all equipment that you have access for.
$filter: allows you to specify a search text using which you can filter the items of equipment
Description: Where FILTER_VALUE is the parameter to search the text or a substring of the text and <PROPERTY_NAME> is the attribute that contains the text.
Lets say my AIN 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=appl... -- DId not work
For all above URLs,
I am getting Intrnal 500 Error.
ANy help would be useful.
Hi Soham,
I had the same problem. I can tell you how I find out the application / API url:
Go to your SAP Cloud Platform. You should find it entering hana.ondemand.com and do some clicking. In your subaccount navigate to Connectivity>Destinations. There should be a destination called ainapp. It provides a link which looks like https://aina<someID>.hana.ondemand.com/ain/. This is your application url. Use e.g. https://aina<someID>.hana.ondemand.com/ain/services/api/v1/equipment/$count to target the API.
Your credentials (username, password) are part of the request header. I would strongly recommend you to write a UI5 Application inside your Cloud Platform subaccount and use the destination to target the API. Then you don't have to care about the credentials and how to start a ssl encrypted connection.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Nicolas. I was able to find the correct URL of the AIN Application.
I wrote UI5 application to call these AIN APIs and deployed them on SAP MII Server. I am able to call these APIs using UI5 app by passing credentials in my AJAX call.
Thanks for the informaiton though.
Soham
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
12 | |
4 | |
3 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.