StatX REST API
The StatX REST API provides a programmatic interface for any software system to access the StatX back-end. The REST API follows standard REST conventions and allows developers to connect data and updates in external software to stats in StatX.
A simple web interface is available to try out the API live on your own StatX account.
StatX API Test Drive lets you interact with the API from the browser. Follow the steps to authenticate to your own StatX account and you can try out all the API calls on your own data. The documentation provides full and formal syntax of API calls and specific JSON payloads.
API Language Bindings
The StatX REST API can be accessed from any application or programming platform supporting standard https and JSON.
We have provide some language bindings here to provide simple wrappers around the API (more languages to come). Please feel free to make publicly available on GitHub any wrappers you create.
The API can be used in these and other example scenarios:
- An external system of record (like a CRM, bug tracking, Accounting etc.) has some event occur in it (eg: updating an opportunity, closing a bug, change of cash). This triggers a change that should be reflected in the value of a stat and the StatX REST API is called for each event to update a stat.
- An external system has a workflow and a particular step in a workflow needs to be sent to StatX for a user on a mobile phone to provide approval. This causes the creation of an approval or sign-off stat.
- An external system has a report or dashboard and a particular metric or value is of critical importance, for example the number of showstopper bugs or the total committed pipeline value for a region. This critical value needs to be delivered to a mobile phone instead of waiting for the user to come visit the dashboard. The API is used to send the update to the user. The change in value of the stat causes the StatX service to send a push notification to the user’s mobile phone to get her attention.
A StatX user account on a mobile phone (Android or iOS) is a pre-requisite for using the API. Note that StatX user accounts are 1:1 tied to a primary mobile phone number. The API is accessed with the credentials of a user account. Conversely, any user account may access the API, no separate API account is required. Note that any access made through the API has no special account or access privileges in the StatX service. Hence, to enable the API user to share stats with a group, send updates etc, that user must be a member of the relevant group.
The authentication sequence is as follows:
- [Via API] Call Login API endpoint
- [On Phone] Obtain verification code on mobile phone
- [Via API] Provide verification code through API
- [API Response] Get Client ID and Auth Token for use in subsequent API calls
Stats and groups
The API allows for a listing of the groups belonging to to the user, group creation and group member addition.
The API provides calls to obtain a list of stats in a group, to obtain the details of a particular stat and to get and set the notification settings of a stat. The API provides the ability do standard CRUD operations on stats via the API. Each stat type in StatX has a stat-specific payload, relevant to its specific nature and function. See the Formal Documentation for details.