Query User Roles【by roleid】(Optional)
Description
Through requesting the manufacturer's API interface, retrieve information about a player's character. This interface is generally used for page recharging, third-party recharging, and point supplementation operations, where it is necessary to query a player's character information before performing a recharge operation. The basic parameters include: character ID (roleId), current timestamp (timestamp), and MD5 signature (sign). The names of functional variables are determined through consultation between the manufacturer and our product. The KEY value in the sign signature can be customized as long as it is kept confidential, provided by the manufacturer (e.g., 8–32 characters consisting of uppercase and lowercase letters or digits, with no special characters).
Process Flowchart

Request URL (must support both POST and GET methods, POST recommended) Domain path (provided by the manufacturer) such as: http://xxxx.xxxxxx.com/role/info Test server link such as:
http://xxxx.xxxxxx.com/role/info?roleId=3258506&timeStamp=1378456412008&sign=1faec808b862af2d5a726f993477529bRequest Parameters
| Parameter Description | ||
|---|---|---|
| roleId | Character ID | Required |
| timestamp | Timestamp | Required |
| sign | Signature Encryption rule MD5(roleId+ character KEY + timestamp) Character KEY: A confidential value agreed upon in advance by both parties (e.g., 8–32 characters consisting of uppercase and lowercase letters or digits, with no special characters) | Required |
Response Result
| Response Result (Standard JSON format) | ||
|---|---|---|
| Success | {"ret":0,"msg":"ok","data":{"userid":"3520001","roleName":"roleName1","serverName":"server Name1","serverId":"1001","level":30}} | ret:0 Successful reception |
| Failure | {"ret":1001, "msg":"param error"} | Non-zero ret indicates an error. Note: Please inform us if there are defined error codes. |
Response JSON Fields
| Return Parameter Description | ||
|---|---|---|
| ret | Return status | Must return |
| msg | Return message description | Must return (Note: It is recommended that the returned msg accurately describes the reason for the error, and not use reasons like "system busy" for issues such as userId errors.) |
| data | Character information object in array form, such as "data":{"userid":"3520001","roleName":"role Name1","serverName":"server Name1","serverId":"1001","level":30} | Not required for non-zero ret (failure) |
| userid | Character corresponding platform user ID (required when the character exists) | Must return for ret:0, not required for non-zero ret (failure) |
| roleName | Character name (required when the character exists) | Must return for ret:0, not required for non-zero ret (failure) |
| serverId | Server ID (required when the character exists) Note: The vendor's serverId must correspond with the server code we have agreed upon; otherwise, verification will fail. | Must return for ret:0, not required for non-zero ret (failure) |
| serverName | Server name (required when the character exists) | Must return for ret:0, not required for non-zero ret (failure) |
| level | Character level (required when the character exists) | Must return for ret:0, not required for non-zero ret (failure) |
Error Codes
Your side defines them. Non-zero ret values indicate error codes.