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" https://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=" https://splunkbase.splunk.com/api/apps:download/Splunk+for+Unix+and+Linux/4.2.0/unix.spl > unix.spl
What is supported by this API
This documentation applies to the following versions of Splunk® Answers and Splunkbase: splunkbase