POST Login with Verification Code
/openmlbb/user/auth/login
API Path: /api/user/auth/login
Authenticate the player using a verification code to obtain a JWT and session token. This endpoint completes the account login flow, establishes a secure session, and enables authorized access to user-specific resources.
Request body:
- role_id: Player role identifier.
- zone_id: Server zone identifier.
- vc: Verification code sent to the player via in-game mail, valid 5 mins.
The response includes authentication details:
- code: Status code (0 indicates success).
- data.jwt: JSON Web Token used for subsequent authenticated requests.
- data.token: Session token string.
- data.roleid: Player role ID.
- data.zoneid: Player zone ID.
- data.time: Timestamp of login.
- data.module, name, email, mobile, open_id: Metadata fields (may be empty depending on account).
The response confirms successful login and provides the credentials required for accessing other user endpoints.
Python Example
from OpenMLBB import OpenMLBB
client = OpenMLBB()
response = client.user.login(role_id=1234567890, zone_id=1234, vc="1234")
print(response)
Request Body Example
{
"role_id": 1234567890,
"zone_id": 1234,
"vc": 1234
}