Skip to content

Authentication

All endpoints in the Gameye Session API require authentication. This guide explains how to properly authenticate your requests.

The Gameye Session API uses Bearer Token Authentication, which means you need to include an API token in the header of every request.

Add your token to the Authorization header in this format:

Authorization: Bearer YOUR_TOKEN_HERE
GET /session HTTP/1.1
Host: api.gameye.io
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...

To get an API token:

  1. Contact Gameye to set up an account
  2. Request an API token for your account
  3. Store your token securely - treat it like a password!

Here are some best practices for keeping your token secure:

  • Never share your token in public repositories or client-side code
  • Use environment variables to store your token in your applications
  • Consider rotating your token periodically
  • Use the sandbox environment for testing

If authentication fails, you’ll receive a 401 Unauthorized response with details about the error. Common reasons for authentication failure include:

  • Missing token
  • Invalid token format
  • Expired token
  • Token doesn’t have permission for the requested resource
{
"statusCode": 401,
"code": "UNAUTHORIZED",
"message": "Authentication failed",
"details": "Invalid bearer token",
"path": "/session",
"identifier": "abc123",
"timestamp": "2023-04-01T12:00:00Z"
}

Once you’ve set up authentication, you can: