Skip to content

Authentication

To authenticate API requests to the LoyaltyGyre backend, the casino's backend must include a valid API Key in the Authorization header of each request.

Authenticate API Requests

  1. Include the API Key: Every request sent to LoyaltyGyre’s API requires the casino to pass the API key in the Authorization header. The key should be in the format:
    Authorization: Bearer YOUR_API_KEY
    
  2. Ensure HTTPS: All requests must be sent over HTTPS to guarantee a secure connection.

Errors

If the API key is invalid or missing, the request will fail with an HTTP 401 Unauthorized error.

Example

curl -X POST https://app.loyaltygyre.com/api/box/open \
 -H "Authorization: Bearer YOUR_API_KEY" \
 -H "Content-Type: application/json" \
 -d '{"user_id": "ff2dd814-a79e-4e3d-91fa-4ade5394c2ee", "box_id": "6f15000a-eb1f-4bce-8b12-ed007f266120"}'
const axios = require('axios');

axios.post('https://app.loyaltygyre.com/api/box/open',
  {
    user_id: 'ff2dd814-a79e-4e3d-91fa-4ade5394c2ee',
    box_id: '6f15000a-eb1f-4bce-8b12-ed007f266120',
  },
  {
    headers: {
      'Authorization': 'Bearer YOUR_API_KEY',
      'Content-Type': 'application/json'
    }
  }
)
.then(response => {
  console.log('Response:', response.data);
})
.catch(error => {
  console.error('Error:', error.response ? error.response.data : error.message);
});
$client = new \GuzzleHttp\Client();
$response = $client->post('https://app.loyaltygyre.com/api/box/open', [
  'headers' => [
    'Authorization' => 'Bearer YOUR_API_KEY',
    'Content-Type'  => 'application/json',
  ],
  'json' => [
    'user_id' => 'ff2dd814-a79e-4e3d-91fa-4ade5394c2ee',
    'box_id' => '6f15000a-eb1f-4bce-8b12-ed007f266120',
  ]
]);

$body = $response->getBody();
$data = json_decode($body, true);
print_r($data);