check_activation_code

To check if a specific activation code is available (unassigned), use the user/check_activation_code method.

Endpoint

Copied!
svc=user/check_activation_code&params={
  "code": "<text>"
}

Parameters

The request must contain the code parameter, specifying the GUID of the code you want to check.

Response

If the request is completed successfully, the response is returned in the following format:

Copied!
{
  "guid": <text>,  /* GUID of the activation code. */
  "tme": <uint>,   /* Code expiration time, UNIX time. */
  "tma": <uint>,   /* Time when the code was assigned to a unit, UNIX time. */
  "tmc": <uint>,   /* Code creation time, UNIX time. */
  "use": <int>     /* Indicates whether the code is in use (1) or not (0). */
}

The code is searched for among all the activation codes of the top user of your hierarchy. The response contains the data of the specified code only.

If the code isn’t found, no code data is returned. Instead, the response contains the error code 0 and the CODE_NOT_EXIST reason:

Copied!
{
  "error": 0,
  "reason": "CODE_NOT_EXIST"
}

If the request fails, an error code is returned.

Error codes

Error code Description
4 Invalid input parameters.
6 Internal server error.
7 Unauthorized user or access denied.

If you find a mistake in the text, please select it and press Ctrl+Enter.