<?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 [Noob Question] Why do API calls from Javascript require a special library? in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Noob-Question-Why-do-API-calls-from-Javascript-require-a-special/m-p/153410#M9404</link>
    <description>&lt;P&gt;I am looking at &lt;A href="http://dev.splunk.com/view/javascript-sdk/SP-CAAAEC9"&gt;this&lt;/A&gt; example. I just want to make a search in Splunk using the the API inside some Javascript.&lt;/P&gt;

&lt;P&gt;This indicates I need to have &lt;CODE&gt;splunk.js&lt;/CODE&gt; on the server making the API call. Am I reading this correctly?&lt;/P&gt;

&lt;P&gt;However I can run simple API calls using &lt;CODE&gt;curl&lt;/CODE&gt; by passing some basic info, like the search and log in creds, and get back the data I want. No extras needed.&lt;/P&gt;

&lt;P&gt;Can I not do this same thing using Javascript without needing the Splunk specific js files? &lt;/P&gt;</description>
    <pubDate>Tue, 22 Jul 2014 23:19:27 GMT</pubDate>
    <dc:creator>neiljpeterson</dc:creator>
    <dc:date>2014-07-22T23:19:27Z</dc:date>
    <item>
      <title>[Noob Question] Why do API calls from Javascript require a special library?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Noob-Question-Why-do-API-calls-from-Javascript-require-a-special/m-p/153410#M9404</link>
      <description>&lt;P&gt;I am looking at &lt;A href="http://dev.splunk.com/view/javascript-sdk/SP-CAAAEC9"&gt;this&lt;/A&gt; example. I just want to make a search in Splunk using the the API inside some Javascript.&lt;/P&gt;

&lt;P&gt;This indicates I need to have &lt;CODE&gt;splunk.js&lt;/CODE&gt; on the server making the API call. Am I reading this correctly?&lt;/P&gt;

&lt;P&gt;However I can run simple API calls using &lt;CODE&gt;curl&lt;/CODE&gt; by passing some basic info, like the search and log in creds, and get back the data I want. No extras needed.&lt;/P&gt;

&lt;P&gt;Can I not do this same thing using Javascript without needing the Splunk specific js files? &lt;/P&gt;</description>
      <pubDate>Tue, 22 Jul 2014 23:19:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Noob-Question-Why-do-API-calls-from-Javascript-require-a-special/m-p/153410#M9404</guid>
      <dc:creator>neiljpeterson</dc:creator>
      <dc:date>2014-07-22T23:19:27Z</dc:date>
    </item>
    <item>
      <title>Re: [Noob Question] Why do API calls from Javascript require a special library?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Noob-Question-Why-do-API-calls-from-Javascript-require-a-special/m-p/153411#M9405</link>
      <description>&lt;P&gt;I think it is possible but you may spend lots and lots of time in writing the core scripts. That could be something like writing your own base code similar to what Service class provides. &lt;BR /&gt;
If you look at the documentation of Service Class at &lt;A href="http://docs.splunk.com/DocumentationStatic/JavaScriptSDK/1.4/splunkjs.Service.html"&gt;http://docs.splunk.com/DocumentationStatic/JavaScriptSDK/1.4/splunkjs.Service.html&lt;/A&gt; they have exposed so many methods to access splunk's resources. It is worth to use the existing libraries and build our features on top of that rather than developing something from scratch.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Jul 2014 01:45:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Noob-Question-Why-do-API-calls-from-Javascript-require-a-special/m-p/153411#M9405</guid>
      <dc:creator>strive</dc:creator>
      <dc:date>2014-07-23T01:45:28Z</dc:date>
    </item>
    <item>
      <title>Re: [Noob Question] Why do API calls from Javascript require a special library?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Noob-Question-Why-do-API-calls-from-Javascript-require-a-special/m-p/153412#M9406</link>
      <description>&lt;P&gt;As strive says, you don't "need" these per se, but why reinvent the wheel? What these libraries do is wrap up a lot of the low level stuff, providing convenience functions. A line of curl is fine, but what about things like exception handling? Once you start making your code robust, you'll probably find yourself writing something very similar to what their libraries already do.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Jul 2014 03:56:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Noob-Question-Why-do-API-calls-from-Javascript-require-a-special/m-p/153412#M9406</guid>
      <dc:creator>airsplunk</dc:creator>
      <dc:date>2014-07-23T03:56:38Z</dc:date>
    </item>
  </channel>
</rss>

