Breadcrumbs

Validate a user token

The method and parameters

POST  /api/v1/billing/user/tokens/validate

The user token must be sent in the Authorization header.

It is possible to specify any identifier for the token. For this, send the id field in the request body.

JSON
{
    "id": 123
}

int id – an identifier to set to the token. Must be unique for each token.

201  Created

Successful response

401  Unauthorized

Unsuccessful response: invalid token

422  Unprocessable Entity

Returns a JSON object with an error. For details, see General information > Validation.

JSON
{
    "message": "No error message here",
    "errors": {
        "any_key": [
            "Error details"
        ]
    }
}
cURL
Bash
curl -k --request POST \
	--url 'https://your-domain/api/v1/billing/user/tokens/validate' \
	--header 'Content-Type: application/json' \
	--header 'Accept: application/json' \
	--data '{
    "id": 0
}'
PHP
PHP
$data = array (
  'id' => 0,
);
$context = stream_context_create([
	'ssl'=>['verify_peer' => false],
	'http' => [
		'method' => 'POST',
		'header' => "Content-Type: application/json\r
Accept: application/json",
		'content'=>json_encode($data)
	]
]);
$result = file_get_contents('https://your-domain/api/v1/billing/user/tokens/validate', false, $context);