Updated on 2025-11-13 GMT+08:00

Creating a Task for Managing Federated Users (createTask)

Scenario

This interface is invoked to create a task for managing federated users.

Method

POST

URI

https://Domain name/apiaccess/rest/cc-management/v1/federationUserMgmt/createTask (For example, the domain name is service.besclouds.com.)

Request Description

Table 1 Request header parameters

No.

Parameter

Type

Mandatory or Not

Description

1

X-APP-Key

String

Yes

App key, which is the user ID.

2

Authorization

String

Yes

Authentication field. The format is Bearer {Value of AccessToken returned by the tokenByAkSk interface}. (A space is required after Bearer.)

Table 2 Request body parameters

No.

Parameter

Type

Mandatory or Not

Description

1

requestBody

Object

Yes

Federated user information.

1.1

federationUserList

Array [Object]

Yes

Federated user list.

The number of users cannot exceed 100.

1.1.1

action

String

Yes

Operation type.

  • CREATE
  • MODIFY
  • DISABLE

1.1.2

userName

String

No

Federated user name. This parameter is mandatory when you create a task.

1.1.3

userAccount

String

Yes

Federated user account.

1.1.4

email

String

No

Email address of a federated user. This parameter is mandatory when you create a task.

1.1.5

roleIds

Array [String]

No

List of role IDs assigned to a federated user. Multiple role IDs can be configured.

This parameter is optional when you create or modify a task. This parameter cannot be set for a disabled user.

Response Description

  • Status code: 200
    Table 3 Response body parameters

    No.

    Parameter

    Type

    Mandatory or Not

    Description

    1

    schema

    Object

    Yes

    Operation result.

    1.1

    resultCode

    String

    No

    Return code.

    • 0: success
    • Other values indicate failure. For details, see Table 4.

    1.2

    resultMessage

    String

    No

    Result description.

    1.3

    taskId

    String

    No

    Task ID.

  • Status code: 400

    Incorrect request. Check the request path and parameters.

  • Status code: 401

    Unauthorized operation. 1. Check whether you have purchased related services. 2. Contact customer service to check the status of your account.

  • Status code: 404

    The requested content is not found. Check the request path.

  • Status code: 500

    Business failure. Check the values of parameters in the request.

Error Codes

Table 4 Error codes

Error Code

Description

100-102

The user management list is empty.

100-103

The number of users in the user management list exceeds 100.

100-104

The value of Action must be CREATE, MODIFY, or DISABLE.

100-202

The length of roleIds exceeds the upper limit.

100-203

The userName, roleIds, or mail field is set for a disabled user.

100-204

The value of userAccount is empty or is an empty string.

100-205

The length of userAccount exceeds the upper limit.

100-207

The value of userAccount contains special characters.

100-208

The role ID is not a number.

100-209

When action is set to CREATE, the value of userName is empty or is an empty string.

100-210

The value of userName contains special characters.

100-211

The value of email is empty or is an empty string.

100-212

The value of email contains special characters.

100-213

The length of userName exceeds the upper limit.

100-214

The length of email exceeds the upper limit.

Example

Request header:

x-app-key:9******************************3  
Authorization:Bearer e******************************e  
Content-Type:application/json
Request parameters:
{
    "federationUserList": [
        {
	    "action": "CREATE",
	    "userAccount": "test0616",
	    "userName": "test0616name",
	    "email": "test0616@huawei.com",
	    "roleIds": ["1672380646005741634"]
	},
	{
	    "action": "MODIFY",
	    "userAccount": "test0616",
	    "userName": "test0616new",
	    "email": "test0616new@huawei.com"
	},
	{
	    "action": "DISABLE",
	    "userAccount": "test0616"
	}
    ]
}

Response parameters:

{
     "resultCode": "0",
     "resultMessage": "batch task created successfully.",
     "taskId": "1659444411225432066"
 }