This documentation does not apply to the most recent version of Splunk.
This documentation applies to the following versions of Splunk: 3.3 , 3.3.1 , 3.3.2 , 3.3.3 , 3.3.4 , 3.4 , 3.4.1 , 3.4.2 , 3.4.3 , 3.4.5 , 3.4.6 , 3.4.8 , 3.4.9 , 3.4.10 , 3.4.11 , 3.4.12 , 3.4.13
While the REST interface still has support for legacy methods through the InvokeAPI endpoint, these methods are being phased out and turned into new REST endpoints.
Note: Any auth token you get through the invokeapi endpoint is not compatible with the other existing REST endpoints.
CAUTION: Methods here may not be supported in future releases.
The /services/invokeapi/legacy_method_name provides access to legacy invokeAPI method calls.
Calls the invokeAPI method, as defined in legacy_method_name.
The invokeAPI method calls originally used XML as the input parameter. In order map XML into flat querystring arguments, the following translation is used:
* <key>foo</key> ==> key=foo
* <key attr1="bar">foo</key> ==> key=foo&key@attr1=bar
* <key><key2>foo</key2></key> ==> key.key2=foo
So, for example:
<call name="getUserInfo"> <params> <key1>foo</key1> <key2 attr1="bar">baz</key2> <key3> <key4>boo</key4> </key3> </params> </call>
is called by converting the XML node and attribute names into serialized strings:
/services/invokeapi/getUserInfo?key1=foo&key2=baz&key2@attr1=bar&key3.key4=boo
| Query | Arguments |
<legacy_arg> | The key name corresponds to the XML parameter, as defined by the XML structure. The value passed is the value assigned to the key name. |
| Response | Status |
| 200 | Method executed successfully. |
| 401 | Login credentials failed. |
| 500 | There was an error; see body contents for messages. |
// The return content is arbitrary XML returned by each method.
// sample response to /services/invokeapi/getUserInfo?userId=1
<user>
<id>1</id>
<name>admin</name>
<password>********</password>
<realName>Administrator</realName>
<userType>
<role>Admin</role>
</userType>
</user>
Identical to GET, except that arguments are passed via form arguments.