Validate login token and return access token

This function validates a login token with the cPanel Store or a cPanel Market provider, and then returns access tokens.

SecurityBasicAuth
Request
query Parameters
login_token
required
string

The login token to validate.

Example: login_token=1a676e6f-99fc-11e6-9ab6-e60a769b73bc
provider
required
string

The cPanel Store or cPanel Market provider's name.

Example: provider=cPStore
url_after_login
required
string <url>

The location to which the cPanel Store or cPanel Market provider redirects the user's browser after they log in.

Example: url_after_login=http://hostname.example.com/redirectionlocation.cgi?state
Responses
200

HTTP Request was successful.

Response Schema: application/json
object
object
get/validate_login_token
Request samples
whmapi1 --output=jsonpretty \
  validate_login_token \
  provider='cPStore' \
  url_after_login='http://hostname.example.com/redirectionlocation.cgi?state' \
  login_token='1a676e6f-99fc-11e6-9ab6-e60a769b73bc'
Response samples
application/json
{
  • "data": {
    • "payload": [
      • {
        • "access_token": "b7a6f029-99fc-11e6-a0bd-87581cb027ac",
        • "refresh_token": "b7a7107f-99fc-11e6-a0bd-b46329164206"
        }
      ]
    },
  • "metadata": {
    • "command": "validate_login_token",
    • "reason": "OK",
    • "result": 1,
    • "version": 1
    }
}