<?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: What is the syntax of the search term in REST API ? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/What-is-the-syntax-of-the-search-term-in-REST-API/m-p/82907#M17205</link>
    <description>&lt;P&gt;This is the regular URL call. Specifically, when you specify query parameters to a URL, you specify them as such:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;&lt;A href="http://www.example.com/api/your/resource/here?param1=foo&amp;amp;param2=bar" target="test_blank"&gt;http://www.example.com/api/your/resource/here?param1=foo&amp;amp;param2=bar&lt;/A&gt;&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;In your case however, to create a search job, you need to POST, and so all the parameters go in the body of the POST request, not in the URL, so it will look like this:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;&lt;A href="http://www.example.com/services/search/jobs" target="test_blank"&gt;http://www.example.com/services/search/jobs&lt;/A&gt;&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;with the POST body looking like this:&lt;BR /&gt;
&lt;CODE&gt;search=search%20123&amp;amp;foo=bar&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;When you did that with curl, it did this thing automagically.&lt;/P&gt;</description>
    <pubDate>Sat, 19 Nov 2011 00:49:59 GMT</pubDate>
    <dc:creator>ineeman</dc:creator>
    <dc:date>2011-11-19T00:49:59Z</dc:date>
    <item>
      <title>What is the syntax of the search term in REST API ?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/What-is-the-syntax-of-the-search-term-in-REST-API/m-p/82906#M17204</link>
      <description>&lt;P&gt;This works: &lt;/P&gt;

&lt;P&gt;curl -u admin:changeme -k &lt;A href="https://localhost:8089/services/search/jobs"&gt;https://localhost:8089/services/search/jobs&lt;/A&gt; -d"search=search 123" &lt;/P&gt;

&lt;P&gt;These don't: ( if try to POST the REST API directly .. )  &lt;/P&gt;

&lt;P&gt;&lt;A href="https://localhost:8089/services/search/jobs"&gt;https://localhost:8089/services/search/jobs&lt;/A&gt; search search==123   ( Not working )&lt;/P&gt;

&lt;P&gt;&lt;A href="https://localhost:8089/services/search/jobs/search%20search==123"&gt;https://localhost:8089/services/search/jobs/search%20search==123&lt;/A&gt;  ( Not working )&lt;/P&gt;

&lt;P&gt;&lt;A href="https://localhost:8089/services/search/jobs/search%20search%3D123"&gt;https://localhost:8089/services/search/jobs/search%20search%3D123&lt;/A&gt;  ( Not working )&lt;/P&gt;

&lt;P&gt;&lt;A href="https://localhost:8089/services/search/jobs/search%20search=123"&gt;https://localhost:8089/services/search/jobs/search%20search=123&lt;/A&gt;  ( Not working ) &lt;/P&gt;

&lt;P&gt;&lt;A href="https://localhost:8089/services/search/jobs?search%20search=1"&gt;https://localhost:8089/services/search/jobs?search%20search=1&lt;/A&gt;  (this one bring something back, but not the XML) &lt;/P&gt;

&lt;P&gt;&lt;A href="https://localhost:8089/services/search/jobs?search%20search%3D1"&gt;https://localhost:8089/services/search/jobs?search%20search%3D1&lt;/A&gt; (this one bring something back, but not the XML) &lt;/P&gt;

&lt;P&gt;What is the syntax, please? &lt;BR /&gt;
Any suggestion ? &lt;/P&gt;

&lt;P&gt;Thx a lot&lt;/P&gt;</description>
      <pubDate>Wed, 28 Sep 2011 04:00:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/What-is-the-syntax-of-the-search-term-in-REST-API/m-p/82906#M17204</guid>
      <dc:creator>ppang</dc:creator>
      <dc:date>2011-09-28T04:00:34Z</dc:date>
    </item>
    <item>
      <title>Re: What is the syntax of the search term in REST API ?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/What-is-the-syntax-of-the-search-term-in-REST-API/m-p/82907#M17205</link>
      <description>&lt;P&gt;This is the regular URL call. Specifically, when you specify query parameters to a URL, you specify them as such:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;&lt;A href="http://www.example.com/api/your/resource/here?param1=foo&amp;amp;param2=bar" target="test_blank"&gt;http://www.example.com/api/your/resource/here?param1=foo&amp;amp;param2=bar&lt;/A&gt;&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;In your case however, to create a search job, you need to POST, and so all the parameters go in the body of the POST request, not in the URL, so it will look like this:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;&lt;A href="http://www.example.com/services/search/jobs" target="test_blank"&gt;http://www.example.com/services/search/jobs&lt;/A&gt;&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;with the POST body looking like this:&lt;BR /&gt;
&lt;CODE&gt;search=search%20123&amp;amp;foo=bar&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;When you did that with curl, it did this thing automagically.&lt;/P&gt;</description>
      <pubDate>Sat, 19 Nov 2011 00:49:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/What-is-the-syntax-of-the-search-term-in-REST-API/m-p/82907#M17205</guid>
      <dc:creator>ineeman</dc:creator>
      <dc:date>2011-11-19T00:49:59Z</dc:date>
    </item>
  </channel>
</rss>

