WHM API.
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/
https://{host}:{port}/json-api/
Request
This function generates a random secret and a one-time password authentication (OTP auth) URL for the user. Use the secret that this function returns and a valid verification token with WHM API 1's twofactorauth_set_tfa_config function to configure Two-Factor Authentication (2FA) on an account.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/twofactorauth_generate_tfa_config
- A server running WHM.
https://whm-server.tld:2087/json-api/twofactorauth_generate_tfa_config
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
-u <username>:<password> \
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/twofactorauth_generate_tfa_config{ "data": { "otpauth_str": "otpauth://totp/Example:root?secret=CAOXW75HKYJJ6E5Y&issuer=Example", "secret": "WJ73QJSKZBXCFIPZ" }, "metadata": { "command": "twofactorauth_generate_tfa_config", "reason": "OK", "result": 1, "version": 1 } }
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/twofactorauth_get_issuer
- A server running WHM.
https://whm-server.tld:2087/json-api/twofactorauth_get_issuer
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
-u <username>:<password> \
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/twofactorauth_get_issuer{ "data": { "issuer": "example.cpanel.net", "system_wide_issuer": "example.cpanel.net" }, "metadata": { "command": "twofactorauth_get_issuer", "reason": "OK", "result": 1, "version": 1 } }
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/twofactorauth_get_tfa_config_for_user
- A server running WHM.
https://whm-server.tld:2087/json-api/twofactorauth_get_tfa_config_for_user
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
-u <username>:<password> \
'https://api.docs.cpanel.net/_mock/specifications/whm.openapi/twofactorauth_get_tfa_config_for_user?user=example'{ "data": { "example": { … } }, "metadata": { "command": "twofactorauth_get_tfa_config_for_user", "reason": "OK", "result": 1, "version": 1 } }