Developing Dashboards, Views, and Apps for Splunk Web

 


Legacy methods

This documentation does not apply to the most recent version of Splunk. Click here for the latest version.

Legacy methods

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.

$LEGACY_METHOD_NAME

The /services/invokeapi/legacy_method_name provides access to legacy invokeAPI method calls.

GET

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

QueryArguments
<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

ResponseStatus
200Method executed successfully.
401Login credentials failed.
500There was an error; see body contents for messages.

Response Body

// 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>

POST

Identical to GET, except that arguments are passed via form arguments.

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 , 3.4.14 View the Article History for its revisions.


You must be logged into splunk.com in order to post comments. Log in now.

Was this documentation topic helpful?

If you'd like to hear back from us, please provide your email address:

We'd love to hear what you think about this topic or the documentation as a whole. Feedback you enter here will be delivered to the documentation team.

Feedback submitted, thanks!