Splunkbase Entitlement API Reference

 


About the Splunkbase Entitlement API

About the Splunkbase Entitlement API

The goal of the Splunkbase Entitlement API is to provide programmatic hooks for app developers and owners to grant and track access to restricted apps in Splunkbase.

Access to entitlement data

To access entitlement data, you must be logged into a splunk.com account on Splunkbase. This account must have the appropriate permissions to access and alter the entitlements in question and have retrieved the App ID for the app.

After prompting you for the splunk.com username and password, splunkd makes a call to Splunkbase for an authentication token. This call is an HTTP POST to https://splunkbase.splunk.com/api/account:login/ with the parameters "username" and "password". The response is an XML-Atom with the element "id" containing the 100+ character authentication token. If the username/password was invalid, SB will respond with an HTTP 401 response (Unauthorized) with the header text "Invalid login".

Here's an example using curl on the command line:

[fflanda ~]$ curl -d "username=fflanda_test&password=XXXXXXXX" http://splunkbase.splunk.com/api/account:login/
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <title>Authentication Token</title>
  <updated>2011-12-02T20:39:06+00:00</updated>
  <id>IU+3FCriPoyBTtdfcEMf3e7MqM44/+GSgHIwFJ382bRUtmVUSy7/m77wnlPCkrba0ijqNgvxxeiaGJ9edMXArbt8p3IyKgIcRq4Hk+D04v4=</id>
</feed>

Subsequent calls to Splunkbase API endpoints should have this authentication token passed to the server in a "X-Auth-Token" header (Splunkbase doesn't use the "Authorization" digest header as defined in RFC2617). This token will last for 24 hours. There is no need to re-request new copies of the token. When it expires, an API call attempt will result in an HTTP 400 response "Token Expired". As an example of using this token, here is downloading an app via the command line with curl:

curl -v -H"X-Auth-Token: IU+3FCriPoyBTtdfcEMf3e7MqM44/+GSgHIwFJ382bRUtmVUSy7/m77wnlPCkrba0ijqNgvxxeiaGJ9edMXArbt8p3IyKgIcRq4Hk+D04v4=" http://splunkbase.splunk.com/api/apps:download/Splunk+for+Unix+and+Linux/4.2.0/unix.spl > unix.spl

This documentation applies to the following versions of Splunkbase: current 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!