Frequently Asked Question

Account Endpoint - Get Credit and Tokens
Last Updated 7 days ago

Account API

Overview

The Account API provides information about a user's account balance and tokens.

Version

1.000

Endpoint

/v2/account.php

Authentication

This API requires authentication using an API key. The key should be passed in the HTTP_X_API_KEY header.

Request

This API doesn't require any parameters in the request body.

Response

The API returns a JSON object with the following structure:

Field Type Description
status string The status of the request. Possible values: "success", "Error", or the validation status if authentication fails.
balance float The user's account balance. Only present if status is "success".
tokens integer The number of tokens in the user's account. Only present if status is "success".
user string The user's status. Only present if status is "success".

Example Response


{
  "status": "success",
  "balance": 100.50,
  "tokens": 500,
  "user": "active"
}

Error Handling

  • If the API key is invalid or the user is not found, the response will only contain the "status" field with the error message.
  • If the user is found but there's an error retrieving the account details, the status will be set to "Error".
  • If for any reason the status is not set during processing, it will default to "fail".

Notes


    Security

    • Ensure that the API key is kept secure and not exposed in client-side code.
    • All responses are sent with the "Content-Type: application/json" header.
    This website relies on temporary cookies to function, but no personal data is ever stored in the cookies.
    OK
    Powered by GEN UK CLEAN GREEN ENERGY

    Loading ...