Ask or search…
K
Links
🛂

Authentication

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

Generating a client_id & client_secret

You can generate a client_id & client_secret by heading to the Stampede dashboard > Marketplace > API Keys > Create New API Key.
From there, you'll be able to create a new client_id then in return will provide you with a client_secret. Keep it safe so it saves the hassle...

Generating a Bearer Token (also known as app-only)

post
~
/oauth/token
Generate a Bearer Token
Parameters
Body
client_id*
client_secret*
grant_type*
client_credentials
Responses
200: OK
400: Bad Request

Examples

Curl
NodeJs - Axios
PHP - Guzzle
Python - http.client
curl --location 'https://global.stampede.ai/oauth/token' \
--header 'Content-Type: application/json' \
--data '{
"client_id": "ai.stampede.marketplace.example",
"client_secret": "XXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"grant_type": "client_credentials"
}'
const axios = require('axios');
let data = JSON.stringify({
"client_id": "ai.stampede.marketplace.example",
"client_secret": "XXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"grant_type": "client_credentials"
});
let config = {
method: 'post',
maxBodyLength: Infinity,
url: 'https://global.stampede.ai/oauth/token',
headers: {
'Content-Type': 'application/json'
},
data : data
};
axios.request(config)
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});
<?php
$client = new Client();
$headers = [
'Content-Type' => 'application/json'
];
$body = '{
"client_id": "ai.stampede.marketplace.example",
"client_secret": "XXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"grant_type": "client_credentials"
}';
$request = new Request('POST', 'https://global.stampede.ai/oauth/token', $headers, $body);
$res = $client->sendAsync($request)->wait();
echo $res->getBody();
import http.client
import json
conn = http.client.HTTPSConnection("global.stampede.ai")
payload = json.dumps({
"client_id": "ai.stampede.marketplace.example",
"client_secret": "XXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"grant_type": "client_credentials"
})
headers = {
'Content-Type': 'application/json'
}
conn.request("POST", "/oauth/token", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))