<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Question Re: How to call AIN APIs from Javascript in Supply Chain Management Q&amp;A</title>
    <link>https://community.sap.com/t5/supply-chain-management-q-a/how-to-call-ain-apis-from-javascript/qaa-p/621884#M9528</link>
    <description>&lt;P&gt;Thanks Nicolas. I was able to find the correct URL of the AIN Application.&lt;/P&gt;
  &lt;P&gt;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.&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;Thanks for the informaiton though.&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;Soham&lt;/P&gt;</description>
    <pubDate>Mon, 23 Apr 2018 23:20:07 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2018-04-23T23:20:07Z</dc:date>
    <item>
      <title>How to call AIN APIs from Javascript</title>
      <link>https://community.sap.com/t5/supply-chain-management-q-a/how-to-call-ain-apis-from-javascript/qaq-p/621881</link>
      <description>&lt;P&gt;Hello Experts,&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;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.&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;The API URL Provided in the SAP AIN document is: &lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;Application_URL/services/api/v1/equipment/$count&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;H1&gt;&lt;/H1&gt;
  &lt;H1&gt;Viewing the Equipment Count&lt;/H1&gt;
  &lt;P&gt;You use this API to get a count of all equipment that you have access for.&lt;/P&gt;
  &lt;H2&gt;Request&lt;/H2&gt;
  &lt;UL&gt;
   &lt;LI&gt;HTTP Method: GET&lt;/LI&gt;
   &lt;LI&gt;URL: Application_URL/services/api/v1/equipment/$count?$filter substringof(&amp;lt;FILTER_VALUE&amp;gt;, &amp;lt;PROPERTY_NAME&amp;gt;)&lt;/LI&gt;
   &lt;LI&gt;Query parameters: $filter&lt;P&gt;&lt;/P&gt;&lt;P&gt;$filter: allows you to specify a search text using which you can filter the items of equipment&lt;/P&gt;&lt;P&gt;Description: Where FILTER_VALUE is the parameter to search the text or a substring of the text and &amp;lt;PROPERTY_NAME&amp;gt; is the attribute that contains the text.&lt;/P&gt;&lt;/LI&gt;
   &lt;LI&gt;Example URL: /ain/services/api/v1/equipment/$count?$filter=substringof('Sample equipment',Name)&lt;/LI&gt;
   &lt;LI&gt;Authorization: You must have the roles EQUIPMENT_READ or EQUIPMENT_EDIT or EQUIPMENT_DELETE assigned to your user IDin the SAP Cloud Platform account.&lt;/LI&gt;
  &lt;/UL&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;Lets say my AIN URL is:&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt; &lt;A href="https://abcxyz.dispatcher.hana.ondemand.com/sites?hc_reset#Shell-home" target="test_blank"&gt;https://abcxyz.dispatcher.hana.ondemand.com/sites?hc_reset#Shell-home&lt;/A&gt;&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;I tried below approaches to form API URL:&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;&lt;A href="https://abcxyz.dispatcher.hana.ondemand.com/services/api/v1/equipment/$count" target="test_blank"&gt;https://abcxyz.dispatcher.hana.ondemand.com/services/api/v1/equipment/$count&lt;/A&gt;  -- Did not work&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;&lt;BR /&gt;&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;&lt;A href="https://abcxyz.dispatcher.hana.ondemand.com/sites/services/api/v1/equipment/$count" target="test_blank"&gt;https://abcxyz.dispatcher.hana.ondemand.com/sites/services/api/v1/equipment/$count&lt;/A&gt; -- Did not work&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;&lt;A href="https://abcxyz.dispatcher.hana.ondemand.com/sites/services/api/v1/equipment/$count?content-type=application/json" target="test_blank"&gt;https://abcxyz.dispatcher.hana.ondemand.com/sites/services/api/v1/equipment/$count?content-type=application/json&lt;/A&gt; -- DId not work&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;For all above URLs,&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;I am getting Intrnal 500 Error.&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;UL&gt;
   &lt;LI&gt;So what can be the way to form AIN API URL? &lt;/LI&gt;
   &lt;LI&gt;Also How do I pass basic authentication like username and password in HttpRequest in Javascript?&lt;/LI&gt;
  &lt;/UL&gt;
  &lt;P&gt;ANy help would be useful.&lt;/P&gt;</description>
      <pubDate>Fri, 30 Mar 2018 22:12:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/supply-chain-management-q-a/how-to-call-ain-apis-from-javascript/qaq-p/621881</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2018-03-30T22:12:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to call AIN APIs from Javascript</title>
      <link>https://community.sap.com/t5/supply-chain-management-q-a/how-to-call-ain-apis-from-javascript/qaa-p/621882#M9526</link>
      <description>&lt;P&gt;Hi Soham,&lt;/P&gt;
  &lt;P&gt;I had the same problem. I can tell you how I find out the application / API url:&lt;BR /&gt;Go to your SAP Cloud Platform. You should find it entering hana.ondemand.com and do some clicking. In your subaccount navigate to Connectivity&amp;gt;Destinations. There should be a destination called ainapp. It provides a link which looks like &lt;A href="https://aina&amp;lt;someID&amp;gt;.hana.ondemand.com/ain/" target="test_blank"&gt;https://aina&amp;lt;someID&amp;gt;.hana.ondemand.com/ain/&lt;/A&gt;. This is your application url. Use e.g. &lt;A href="https://aina&amp;lt;someID&amp;gt;.hana.ondemand.com/ain/services/api/v1/equipment/$count" target="test_blank"&gt;https://aina&amp;lt;someID&amp;gt;.hana.ondemand.com/ain/services/api/v1/equipment/$count&lt;/A&gt; to target the API.&lt;/P&gt;
  &lt;P&gt;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.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Apr 2018 15:02:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/supply-chain-management-q-a/how-to-call-ain-apis-from-javascript/qaa-p/621882#M9526</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2018-04-04T15:02:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to call AIN APIs from Javascript</title>
      <link>https://community.sap.com/t5/supply-chain-management-q-a/how-to-call-ain-apis-from-javascript/qaa-p/621883#M9527</link>
      <description>&lt;P&gt;Just found a better way to find out the application url. In your Cloud Platform navigate to Applications&amp;gt;Subscriptions. You can click on the java application "ain". On the following page you can find the application url.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Apr 2018 07:37:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/supply-chain-management-q-a/how-to-call-ain-apis-from-javascript/qaa-p/621883#M9527</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2018-04-06T07:37:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to call AIN APIs from Javascript</title>
      <link>https://community.sap.com/t5/supply-chain-management-q-a/how-to-call-ain-apis-from-javascript/qaa-p/621884#M9528</link>
      <description>&lt;P&gt;Thanks Nicolas. I was able to find the correct URL of the AIN Application.&lt;/P&gt;
  &lt;P&gt;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.&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;Thanks for the informaiton though.&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;Soham&lt;/P&gt;</description>
      <pubDate>Mon, 23 Apr 2018 23:20:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/supply-chain-management-q-a/how-to-call-ain-apis-from-javascript/qaa-p/621884#M9528</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2018-04-23T23:20:07Z</dc:date>
    </item>
  </channel>
</rss>

