> ## Documentation Index
> Fetch the complete documentation index at: https://apidocs.oppigames.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Game Session

> This api is used for get game session based on Player sessionId.

## Headers

<ParamField header="x-api-key" type="string" required>
  A unique identifier associated with operator calling API.
</ParamField>

<ParamField header="x-signature" type="string" required>
  A SHA256 HMAC signature generated using the request body and timestamp.
  Format: HMAC\_SHA256(JSON.stringify(data) + '|' + timestamp), signed using the
  provided secret key.
</ParamField>

<ParamField header="x-timestamp" type="string" required>
  An Unix timestamp (milliseconds) Used to verify the request’s freshness.
  Ensure the same value is used in signature generation.

  <Note>
    The signature will remain valid for only 5 minutes from the provided
    timestamp.
  </Note>
</ParamField>

<ParamField header="Content-Type" type="string" required>
  Must be set to `application/json`.
</ParamField>

## Query Parameters

<ParamField query="page" type="number" default={1}>
  Specifies the current page number for pagination purposes.
</ParamField>

<ParamField query="limit" type="number" default={10}>
  Specifies how many records to display on each page, controlling the size of
  each data segment.
</ParamField>

<ParamField query="sessionId" type="string" required>
  A unique identifier for the game session you want to retrieve.
</ParamField>

## Response

<ResponseField name="status" type="string" required>
  Code indicates status of the request weather it is succeed or failed. We have listed error codes <a href="/introduction#error-codes">here</a>
</ResponseField>

<ResponseField name="data" type="Data Object">
  <Expandable title="Data properties">
    <ResponseField name="currentPage" type="integer" required>
      The current page number of the results.
    </ResponseField>

    <ResponseField name="totalPages" type="integer" required>
      The total number of pages available.
    </ResponseField>

    <ResponseField name="totalCount" type="integer" required>
      The total number of records matching the query.
    </ResponseField>

    <ResponseField name="result" type="array" required>
      An array of session objects containing details about each game session.
    </ResponseField>

    <Expandable title="Result properties">
      <ResponseField name="transactionId" type="string" required>
        Unique identifier for the transaction.
      </ResponseField>

      <ResponseField name="sessionId" type="string" required>
        Unique identifier for the player’s game session.
      </ResponseField>

      <ResponseField name="playerId" type="string" required>
        Unique identifier for the player.
      </ResponseField>

      <ResponseField name="playerName" type="string" required>
        Display name of the player.
      </ResponseField>

      <ResponseField name="betAmount" type="number" required>
        The amount wagered by the player.
      </ResponseField>

      <ResponseField name="payout" type="number" required>
        The payout amount awarded to the player.
      </ResponseField>

      <ResponseField name="isWin" type="boolean" required>
        Indicates whether the player won the bet.
      </ResponseField>

      <ResponseField name="sessionStatus" type="integer" required>
        Status code of the game session (e.g., 1 for active).
      </ResponseField>

      <ResponseField name="gameId" type="string" required>
        Unique identifier for the game.
      </ResponseField>

      <ResponseField name="gameName" type="string" required>
        Name of the game.
      </ResponseField>

      <ResponseField name="createdAt" type="string" required>
        Timestamp indicating when the transaction was created (UTC format).
      </ResponseField>
    </Expandable>
  </Expandable>
</ResponseField>

<ResponseExample>
  ```json SUCCESS OK theme={null}

      {
      "status": "RS_OK",
      "data": {
          "totalPages": 1,
          "currentPage": 1,
          "totalCount": 41,
          "result": [
              {
                  "transactionId": "7f4ef777-7ad7-486a-8186-249e99ba715a",
                  "sessionId": "d404f1da-26a6-44ff-8b0f-559915152be11742537289208",
                  "playerId": "PAWAN_PAREEK1",
                  "playerName": "PAWAN PAREEK",
                  "betAmount": 50,
                  "payout": 60,
                  "isWin": true,
                  "sessionStatus": 1,
                  "gameId": "G1742465405970",
                  "gameName": "Cricket Crash",
                  "createdAt": "2025-03-21T11:02:46.615Z"
              }
          ]
      }

  }

  ```

  ```json FAILURE theme={null}
  {
    "status": "RS_ERROR",
    "message": "Oops! Something went wrong. Please refresh the page or try again in a moment"
  }
  ```
</ResponseExample>
