# Validate Customer Portal OAuth2 code This function validates the OAuth2 code from the cPanel Customer Portal. After the function validates the token, the system stores it on the current session. This function is available through the command line. You call it as a request body. Endpoint: GET /ticket_validate_oauth2_code Version: 11.134.0.5 Security: BasicAuth ## Query parameters: - `code` (string, required) The code from the OAuth2 redirect. The system validates this code and exchanges it for a token. Example: "84b1a729-63e3-11e6-a0fb-bfcf357fd76d" - `redirect_uri` (string, required) The redirect URI query argument that the system sent to the initial OAuth2 authentication endpoint. Example: "https://hostname.example.com:2087/" ## Response 200 fields (application/json): - `metadata` (object) - `metadata.command` (string) The method name called. Example: "ticket_validate_oauth2_code" - `metadata.reason` (string) The reason the API function failed when the field is . This field may display a success message when a function succeeds. Example: "OK" - `metadata.result` (integer) * — Success. * — Failed. Check the field for more details. Enum: 0, 1 - `metadata.version` (integer) The version of the API function. Example: 1