Obtain a regular user token
Brief Description
- Administrators can obtain user tokens.
⚠️ Note: OpenIMServer has a built-in app administrator, whose userID
is imAdmin
.
Request Method
post
Request URL
http://x.x.x.x:10002/auth/get_user_token
Header
Header Name | Example Value | Optional | Type | Description |
---|---|---|---|---|
operationID | 1646445464564 | Required | string | operationID is used for global link tracking |
token | eyJhbxxxx3Xs | Required | string | Administrator token |
Request Example
{
"platformID": 1,
"userID": "111111"
}
Field Name | Optional | Type | Explanation |
---|---|---|---|
platformID | Required | int | Platform ID, 1: iOS, 2: Android, 3: Windows, 4: OSX, 5: Web, 6: MiniWeb, 7: Linux, 8: Android Pad, 9: iPad, 10: admin |
userID | Required | string | User ID |
Successful Return Example
{
"errCode": 0,
"errMsg": "",
"errDlt": "",
"data": {
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJVc2VySUQiOiJvcGVuSU1BZG1pbiIsIlBsYXRmb3JtSUQiOjEsImV4cCI6MTY5Njc1NDgwNSwibmJmIjoxNjg4OTc4NTA1LCJpYXQiOjE2ODg5Nzg4MDV9.SAu86X3PzfYjtjBeYA4vZefNr1IiFKRgg12FeiXSm14",
"expireTimeSeconds": 7776000
}
}
Explanation of Parameters in Successful Return
Parameter Name | Type | Explanation |
---|---|---|
errCode | int | Error code, 0 indicates success |
errMsg | string | Brief error message, empty if there is no error |
errDlt | errDlt | Detailed error message, empty if there is no error |
data | object | General data object, specific structure shown below |
token | string | Obtained user token |
expireTimeSeconds | string | Token expiration time (in seconds) |
Failed Return Example
{
"errCode": 1004,
"errMsg": "RecordNotFoundError",
"errDlt": ": [1004]RecordNotFoundError"
}
Explanation of Parameters in Failed Return
Parameter Name | Type | Explanation |
---|---|---|
errCode | int | Error code, see the global error code document for details |
errMsg | string | Brief error message |
errDlt | errDlt | Detailed error message |