Stampede's API enables users to interact with its infrastructure by pushing customer data, creating in-venue orders, or WiFi interactions, facilitating system integration. The API requires authentication via OAuth 2.0 using Bearer Tokens, which are included in request headers. Users must access Stampede's product to generate a Client ID and secret token, leading to the creation of a Bearer Token. This token, which expires in 24 hours, is essential for secure API requests. The API is rate-limited to 100 requests per 15 minutes.
With Stampede's API, you'll have the opportunity to interact with Stampede's infrastructure like pushing customer data, creating an in-venue order or creating a WiFi interaction. This allows you to securely extend the functionality of Stampede and integrate your systems with us.
Base URLs and Limiting
All API requests are sent to our base URL here:
https://global.stampede.ai/
To protect the service and ensure a high level of availability and performance, we do rate-limit requests received through the API endpoints. This is currently set to a maximum of 100 requests every 15 minutes. All requests should be sent with the header Content-Type: application/json as part of the request
Authentication
To authenticate with the Stampede API, you will need to either have access to the product at https://product.stampede.ai or request access from the account holder.
Admin Access Warning
Continuing past this point and creating API credentials will give the user admin credentials to your organisation. For more information on roles within the product, see this article.
For authenticating requests with Stampede, we utilise the OAuth 2.0 protocol, specifically using Bearer Tokens. Your integration must include these Bearer Tokens in the request headers to ensure secure and authorised access. This can look like this within your request headers:
authorization: Bearer XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Generate a client ID and secret token
To create a Client ID and secret token, follow the steps below:
- Login to the Stampede Product: https://product.stampede.ai/
- Navigate to Marketplace > API Keys & Webhooks
- Click the plus symbol to create a new API key
- Set the application name, we recommend using reverse domain notation e.g. example.com = com.example
- Your new API key will then be displayed as below:
- Tap the Reveal Secret icon to copy the secret key to your clipboard. The same action works for the Client ID
Generate a Bearer Token
You can now use the client ID and secret to generate a bearer token. The JSON payload is made up of the following entries:
Name | Type | Required | Description |
---|---|---|---|
client_id | String | Yes | Generated within the product |
client_secret | String | Yes | Generated within the product |
grant_type | String | Yes | set to client_credentials to identify the request |
The API call for this method is as follows:
Method: POST URL: https://global.stampede.ai/oauth/token JSON payload: { "client_id": "ai.stampede.marketplace.example", "client_secret": "XXXXXXXXXXXXXXXXXXXXXXXXXXXX", "grant_type": "client_credentials" }
This will return your bearer token as a JSON payload. Example below:
{ "access_token": "f2628b2615adxxxxxxxxcf4d09fbeb8aa233bbc5", "expires_in": 86400, "token_type": "Bearer", "scope": "ALL:ALL" }
You will now be able to send further requests to the API using your bearer token. The default expiry is set to 24 hours after which you will need to create a new token.
Comments
0 comments
Please sign in to leave a comment.