curl --request GET \
--url https://api.example.com/api/v1/player \
--header 'x-stash-hmac-signature: <api-key>'import requests
url = "https://api.example.com/api/v1/player"
headers = {"x-stash-hmac-signature": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-stash-hmac-signature': '<api-key>'}};
fetch('https://api.example.com/api/v1/player', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/v1/player",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-stash-hmac-signature: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/v1/player"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-stash-hmac-signature", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/api/v1/player")
.header("x-stash-hmac-signature", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/player")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-stash-hmac-signature"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"player": {
"playerId": "<string>",
"name": "<string>",
"avatarUrl": "<string>",
"language": "<string>",
"inGameLevel": 123,
"inGameCurrency": "<string>",
"region": "<string>",
"currency": "<string>",
"wallet": [
{
"bonusId": "<string>",
"bonusType": "WALLET_BONUS_TYPE_UNSPECIFIED",
"balance": "<string>"
}
]
}
}{
"code": 123,
"message": "<string>",
"details": [
{
"@type": "<string>"
}
]
}Get player by ID
Retrieves an existing player by ID. Returns player information including profile data and in-game currency balances.
curl --request GET \
--url https://api.example.com/api/v1/player \
--header 'x-stash-hmac-signature: <api-key>'import requests
url = "https://api.example.com/api/v1/player"
headers = {"x-stash-hmac-signature": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-stash-hmac-signature': '<api-key>'}};
fetch('https://api.example.com/api/v1/player', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/v1/player",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-stash-hmac-signature: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/v1/player"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-stash-hmac-signature", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/api/v1/player")
.header("x-stash-hmac-signature", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/player")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-stash-hmac-signature"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"player": {
"playerId": "<string>",
"name": "<string>",
"avatarUrl": "<string>",
"language": "<string>",
"inGameLevel": 123,
"inGameCurrency": "<string>",
"region": "<string>",
"currency": "<string>",
"wallet": [
{
"bonusId": "<string>",
"bonusType": "WALLET_BONUS_TYPE_UNSPECIFIED",
"balance": "<string>"
}
]
}
}{
"code": 123,
"message": "<string>",
"details": [
{
"@type": "<string>"
}
]
}Authorizations
Versioned HMAC-SHA256 signature for server-to-server communication between game backends and Stash services. Recommended over the deprecated legacyHmac scheme for the best security. Header format: v1;{shopId};{unixMillisTimestamp};{base64Signature} (semicolon-delimited). {base64Signature} is the base64-encoded HMAC-SHA256 of the string {unixMillisTimestamp}.{requestBody} signed with your Egress API key, where {requestBody} is the compact request JSON. The timestamp must be within 5 minutes of Stash server time. Your shopId is your immutable shop identifier; it and your Egress API key are available in Stash Studio under Project Settings > API Secrets.