<?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>topic Re: Calling external API from custom widget in ArcGIS Web AppBuilder Questions</title>
    <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/calling-external-api-from-custom-widget/m-p/1036494#M20463</link>
    <description>&lt;P&gt;Try this it might help in resolving the issue.&lt;/P&gt;&lt;P&gt;windows icon -&amp;gt; Right click -&amp;gt; command prompt(Admin)&lt;/P&gt;&lt;P&gt;In command prompt window the type&amp;nbsp;&lt;/P&gt;&lt;P&gt;C:\Windows\system32&amp;gt;cd .\drivers\etc and enter&lt;/P&gt;&lt;P&gt;C:\Windows\system32\drivers\etc&amp;gt;notepad hosts&lt;/P&gt;&lt;P&gt;A notepad of Hosts opens. Add the dns entry in the file like&amp;nbsp;&lt;/P&gt;&lt;P&gt;10.11.11.11 maps.org.com&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 15 Mar 2021 07:28:45 GMT</pubDate>
    <dc:creator>KafilBaig</dc:creator>
    <dc:date>2021-03-15T07:28:45Z</dc:date>
    <item>
      <title>Calling external API from custom widget</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/calling-external-api-from-custom-widget/m-p/1031468#M20405</link>
      <description>&lt;P&gt;Can we call an external REST API from custom widget ?&lt;/P&gt;</description>
      <pubDate>Mon, 01 Mar 2021 13:44:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/calling-external-api-from-custom-widget/m-p/1031468#M20405</guid>
      <dc:creator>NishthaKalra</dc:creator>
      <dc:date>2021-03-01T13:44:54Z</dc:date>
    </item>
    <item>
      <title>Re: Calling external API from custom widget</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/calling-external-api-from-custom-widget/m-p/1036460#M20460</link>
      <description>&lt;P&gt;Yes, we can call an external REST API from custom widget. I have done in my custom widget.&amp;nbsp;&lt;/P&gt;&lt;P&gt;For Example the code looks like as below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;FetchData: function () {&lt;/P&gt;&lt;P&gt;var apiUrl = "https://myservername/myApiname/MyMethodName";&lt;/P&gt;&lt;P&gt;var resultDataItems;&lt;/P&gt;&lt;P&gt;$.ajax({&lt;/P&gt;&lt;P&gt;async: false,&lt;/P&gt;&lt;P&gt;type: "GET",&lt;/P&gt;&lt;P&gt;url:&amp;nbsp;apiUrl,&lt;/P&gt;&lt;P&gt;data: {"strParams": strParams},&lt;/P&gt;&lt;P&gt;success: function (result){&lt;/P&gt;&lt;P&gt;resultDataItems = JSON.parse(result);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;});&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now you can bind the result in whatever display component you need in your application , for example Gridview, ListView...&lt;/P&gt;&lt;P&gt;Additionally Add the jquery.min library in your libs folder and reference that in index page.&lt;/P&gt;</description>
      <pubDate>Mon, 15 Mar 2021 04:18:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/calling-external-api-from-custom-widget/m-p/1036460#M20460</guid>
      <dc:creator>KafilBaig</dc:creator>
      <dc:date>2021-03-15T04:18:07Z</dc:date>
    </item>
    <item>
      <title>Re: Calling external API from custom widget</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/calling-external-api-from-custom-widget/m-p/1036484#M20462</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/161710"&gt;@KafilBaig&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I did this but I keep getting CORS error which says that&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Access to fetch at &amp;lt;requested API&amp;gt; from origin &amp;lt;my system&amp;gt; has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Do I need to set something in WAB or AGOL to remove this error?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Mar 2021 06:46:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/calling-external-api-from-custom-widget/m-p/1036484#M20462</guid>
      <dc:creator>NishthaKalra</dc:creator>
      <dc:date>2021-03-15T06:46:01Z</dc:date>
    </item>
    <item>
      <title>Re: Calling external API from custom widget</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/calling-external-api-from-custom-widget/m-p/1036494#M20463</link>
      <description>&lt;P&gt;Try this it might help in resolving the issue.&lt;/P&gt;&lt;P&gt;windows icon -&amp;gt; Right click -&amp;gt; command prompt(Admin)&lt;/P&gt;&lt;P&gt;In command prompt window the type&amp;nbsp;&lt;/P&gt;&lt;P&gt;C:\Windows\system32&amp;gt;cd .\drivers\etc and enter&lt;/P&gt;&lt;P&gt;C:\Windows\system32\drivers\etc&amp;gt;notepad hosts&lt;/P&gt;&lt;P&gt;A notepad of Hosts opens. Add the dns entry in the file like&amp;nbsp;&lt;/P&gt;&lt;P&gt;10.11.11.11 maps.org.com&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Mar 2021 07:28:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/calling-external-api-from-custom-widget/m-p/1036494#M20463</guid>
      <dc:creator>KafilBaig</dc:creator>
      <dc:date>2021-03-15T07:28:45Z</dc:date>
    </item>
  </channel>
</rss>

