Management APIs

Updated at:

Management APIs are generally called by the user management systems of business applications. They are primarily responsible for maintaining account information and managing account lifecycles, and are protected by the management application access token.

1. Token validity verification

Application servers can use this API to verify the validity of a server-side token.

Endpoint:

Request URI: GET /api/bff/v1.2/developer/ciam/management/token/check

​

Response parameters

Response parameters for a valid token

Parameter

Type

Example

success

boolean

true

code

int

Operation.Success

message

string

null

requestId

string

8D5CDDCF-C77A-4A0A-A8A6-16314E57847F

data

json

null

Response parameters for an invalid token:

Parameter

Type

Example

Description

error

string

invalid_token

Invalid.

error_description

int

Invalid access token: eyJhbGciOiJIU ... ... WJferRYl0

The token is invalid.​

2. Get user information

Queries the basic information of a specified user.

Endpoint

Request URI: GET /api/bff/v1.2/developer/ciam/management/user

​

Request parameters

Parameter

Type

Required

Description

userUuid

string

Yes

The unique identifier of the user.

userType

string

No

The custom user type. Defaults to regular user.

​

Response parameters

Parameter

Type

Description

userId

String

The unique identifier of the user.

displayName

String

The display name.

username

String

The username.

phoneNumber

String

The phone number.

phoneRegion

String

The phone area code.

email

String

The email address.

dataDictionaries

Array

Data dictionaries are the mechanism IDaaS uses for extended account attributes. After an administrator defines the custom attributes that an account can store in a data dictionary, custom user data can be stored and retrieved here.

remark

String

The user source.

uamParams

Map

​

locked

boolean

Specifies whether the user account is locked.

enabled

boolean

Specifies whether the user account is disabled.

createTime

Date

The time when the user registered.

sourceApplicationUuid

String

The ID of the application through which the user registered.

​

3. Get user information by social account ID

Queries the corresponding user information by using the unique identifier of the user on social media.

Endpoint

Request URI: GET /api/bff/v1.2/developer/ciam/management/social/userinfo

​

Request parameters

Parameter

Type

Required

Description

socialUserId

string

Yes

The unique identifier of the user on social media.

socialId

string

Yes

The social media type, as defined by IDaaS.

​

Response parameters

Parameter

Type

Description

userUuid

String

The unique identifier of the user.

displayName

String

The display name.

username

String

The username.

phoneNumber

String

The phone number.

phoneRegion

String

The phone area code.

email

String

The email address.

dataDictionaries

Array

Data dictionaries are the mechanism IDaaS uses for extended account attributes. After an administrator defines the custom attributes that an account can store in a data dictionary, custom user data can be stored and retrieved here.

remark

String

The user source.

uamParams

Map

​

locked

boolean

Specifies whether the user account is locked.

enabled

boolean

Specifies whether the user account is disabled.

createTime

Date

The time when the user registered.

sourceApplicationUuid

String

The ID of the application through which the user registered.

​

4. Add a user

Queries the basic information of a specified user.

Endpoint

Request URI: POST /api/bff/v1.2/developer/ciam/management/user

​

Request parameters

Parameter

Type

Required

Description

username

String

Yes

The username.

password

String

Yes

The password.

phoneNumber

String

Yes

The phone number.

phoneRegion

String

No

The phone area code.

email

String

No

The email address.

userType

String

No

The user type.

externalId

String

No

The external ID.

dataDictionaries

Array

No

Data dictionaries are the mechanism IDaaS uses for extended account attributes. After an administrator defines the custom attributes that an account can store in a data dictionary, custom user data can be stored.

Sample request

{
  "username": "pftest125",
  "password": "Test123456",
  "phoneNumber": "178****1215",
  "email": "855******@qq.com",
  "externalId": "125",
  "dataDictionaries": [
    {
      "dictionaryCode": "languages",
      "value": "en"
    },
    {
      "dictionaryCode": "sex",
      "value": "Male"
    }
  ]
}

Response parameters

Parameter

Type

Example

Description

userUuid

String

65********93926885​

The unique identifier of the user in IDaaS.

Sample response

{
    "success": true,
    "code": "Operation.Success",
    "message": "Operation.Success",
    "requestId": "1668062119444$c91e1df2-2450-c0ab-876c-dce7356fbc43",
    "data": {
        "userUuid": "65********93926885"
    }
}

5. Enable a user

After a user is enabled, the user can use the system as expected.

Endpoint

Request URI: POST /api/bff/v1.2/developer/ciam/management/user/enable

Content-Type: application/json

​

Request parameters

Parameter

Type

Required

Description

userUuid

string

Yes

The unique identifier of the user.

userType

userType

No

userType

Response parameters

Parameter

Type

Example

Description

success

boolean

true

The user is enabled.​

code

int

Operation.Success

The result code of the operation.​

message

string

null

Additional information.​

requestId

string

8D5CDDCF-C77A-4A0A-A8A6-16314E57847F

The unique identifier.​

data

json

null

The log.​

​

Error codes

No.

Error code

Description

1

Operation.Success

The request is complete.​

2

Operation.Failure.User.Enabled

The operation failed because the user is already enabled.​

6. Disable a user

Disables a specified user account. After the account is disabled, it cannot perform any operations or log on.

Endpoint

Request URI: POST /api/bff/v1.2/developer/ciam/management/user/disable

Content-Type: application/json

​

Request parameters

Parameter

Type

Required

Description

userUuid

String

Yes

The unique identifier of the user.

userType

userType

No

userType

​

Response parameters

Parameter

Type

Example

Description

success

boolean

true

The request is successful.​

code

int

Operation.Success

The user is disabled.

message

string

null

The request information.​

requestId

string

8D5CDDCF-C77A-4A0A-A8A6-16314E57847F

The unique identifier of the request.

data

json

null

The log.​

​

Error codes

No.

Error code

Description

1

Operation.Success

The user is disabled.

2

Operation.Failure.User.Enabled

The disable operation failed.

7. Unlock a user

When a user exceeds the number of client-side logon attempts set by risk governance, the user is automatically locked for a period of time. Management systems can use this API to proactively unlock the user.

Endpoint

Request URI: POST /api/bff/v1.2/developer/ciam/management/user/unlock

Content-Type: application/json

​

Request parameters

Parameter

Type

Required

Description

userUuid

String

Yes

The unique identifier of the user.

userType

string

No

The custom user type. Defaults to regular user.

​

Response parameters

Parameter

Type

Example

Description

success

boolean

true

The operation is successful.

code

int

Operation.Success

The user is unlocked.

message

string

null

The request information.​

requestId

string

8D5CDDCF-C77A-4A0A-A8A6-16314E57847F

The request ID.

data

json

null

The log.​

​

Error codes

No.

Error code

Description

1

Operation.Success

The user is unlocked.

2

Operation.Failure.User.Enabled

The unlock operation failed.

​

8. Get the WeChat mini program token

The IDaaS server maintains the access token for WeChat mini program applications. Server-side tokens for mini program applications can affect one another; for example, generating a new token invalidates the old token.

When IDaaS uses WeChat mini program authorization for logon, the server must use the mini program access token, which invalidates the access tokens previously used by other applications. Therefore, IDaaS provides this API to obtain the mini program access token.

IDaaS caches the mini program token. When the cache expires, the system automatically requests access_token from WeChat again.

​

Endpoint

Request URI: GET /api/bff/v1.2/developer/ciam/management/token/wechat_micro_program

​

Request parameters

Parameter

Type

Required

Description

enterpriseAuthId

string

Yes

The UUID of the authentication source that corresponds to the WeChat mini program.

Response parameters

Parameter

Type

Example

Description

access_token

string

C77A-4A0A-A8A6-16314E57847F​

The access token obtained.

expires_in

number

3600​

The validity period of the token, in seconds. The current value is within 7,200 seconds.

errcode

number

1​

The error code.

errmsg

string

null​

The error message.