<?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: Call to custom/eai endpoint from setup view in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/Call-to-custom-eai-endpoint-from-setup-view/m-p/533045#M9594</link>
    <description>&lt;P&gt;My goals could also be accomplished with a [script:] stanza as well. Since we are using a setup view now, all the configuration is done with the splunkjs SDK before the python script is called, so I don't necessarily need an eai endpoint. All I'm looking to do is test a connection to a third-party app using a custom endpoint.&lt;/P&gt;&lt;P&gt;Same question applies here though. I've messed with the examples but get 404's through the js sdk using both a [script:] and [admin:]/[admin_external:] endpoint.&lt;/P&gt;</description>
    <pubDate>Mon, 14 Dec 2020 18:21:38 GMT</pubDate>
    <dc:creator>breid1313</dc:creator>
    <dc:date>2020-12-14T18:21:38Z</dc:date>
    <item>
      <title>Call to custom/eai endpoint from setup view</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Call-to-custom-eai-endpoint-from-setup-view/m-p/533036#M9593</link>
      <description>&lt;P&gt;Hello all -&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm creating a setup view (migrating from setup.xml) for an app and would like to continue to leverage the custom eai python handler that is already in place.&lt;/P&gt;&lt;P&gt;Can anyone point me towards an example of this? I may be using web.conf incorrectly as I can access the handler via port 8089 but when I attempt to call the endpoint from the setup view via the splunkjs sdk it generates a 404 error.&lt;/P&gt;&lt;P&gt;Once I resolve this issue I believe I should be able to pass all the parameters necessary into data: {TODO} in order to use the eai handler the same way we were when using setup.xml&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;app.js&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;    callScript(){
      $.ajax({
            type: "POST",
            url: "/servicesNS/-/&amp;lt;app_name&amp;gt;/configureMyApp/handleConfig",
            data: {TODO},
            contentType: "application/json; charset=utf-8",
            dataType: "json",
            success: function(data) {
                console.log("success returned");
                console.log(data);
            },
            error: function(xhr){
     console.log("Error ", xhr);
         }
      });
    }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;restmap.conf&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[admin:configureMyApp]
match                 = /configureMyApp
members               = handleConfig        

[admin_external:handleConfig]
handlertype           = python
python.version        = python3
handlerfile           = handler.py
handleractions        = list, edit
handlerpersistentmode = false&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;web.conf&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[expose:configureMyApp]
methods = GET, POST
pattern = configureMyApp

[expose:handleConfig]
pattern = configureMyApp/*
methods = GET, POST&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Dec 2020 17:11:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Call-to-custom-eai-endpoint-from-setup-view/m-p/533036#M9593</guid>
      <dc:creator>breid1313</dc:creator>
      <dc:date>2020-12-14T17:11:50Z</dc:date>
    </item>
    <item>
      <title>Re: Call to custom/eai endpoint from setup view</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Call-to-custom-eai-endpoint-from-setup-view/m-p/533045#M9594</link>
      <description>&lt;P&gt;My goals could also be accomplished with a [script:] stanza as well. Since we are using a setup view now, all the configuration is done with the splunkjs SDK before the python script is called, so I don't necessarily need an eai endpoint. All I'm looking to do is test a connection to a third-party app using a custom endpoint.&lt;/P&gt;&lt;P&gt;Same question applies here though. I've messed with the examples but get 404's through the js sdk using both a [script:] and [admin:]/[admin_external:] endpoint.&lt;/P&gt;</description>
      <pubDate>Mon, 14 Dec 2020 18:21:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Call-to-custom-eai-endpoint-from-setup-view/m-p/533045#M9594</guid>
      <dc:creator>breid1313</dc:creator>
      <dc:date>2020-12-14T18:21:38Z</dc:date>
    </item>
  </channel>
</rss>

