Updated on 2024-12-30 GMT+08:00

Adding a User Event

This API is used to synchronize new users to the application system.

URL

POST https://{app_domain}/callback

Request Header

Authorization: Bearer {access_token}

Request Parameters

The following request parameters are subject to the identity synchronization parameters configured by enterprises. The administrator can set which attributes to synchronize with the target application by referring to 9.

Table 1 Request parameters

Parameter

Fixed

Type

Description

username

Yes

String(100)

Username.

name

Yes

String(40)

Real name of the user.

organizationId

Yes

String

Organization ID.

password

Yes

String

Password.

disabled

Yes

Boolean

Whether to disable the function. true: disabled; false: enabled.

firstName

No

String(20)

Name.

middleName

No

String(20)

Middle name.

lastName

No

String(20)

Last name.

mobile

No

String

Mobile phone number.

email

No

String

Email address.

extAttr1

No

--

Extended attribute 1, which is an extended user attribute of an enterprise. Set this attribute based on the site requirements.

extAttr2

No

--

Extended attribute 2, which is an extended user attribute of an enterprise. Set this attribute based on the site requirements.

Response Parameters

Table 2 Response parameter

Parameter

Type

Description

id

String(50)

  • User ID generated after a user is created for a downstream enterprise application. The ID is sent back to OneAccess as the unique identifier of the user.
  • When a user is modified or deleted, the ID is passed to the downstream application. The ID must match the one in the downstream application. If they differ, the ID returned by the API will overwrite the previous ID.

Example Request

  • Example request with message signature and encryption enabled:
    {
    	"nonce": "AmgjjEAJbrMzWmUw",
    	"timestamp": 1509384....,
    	"eventType": "CREATE_USER",
    	"data": "6lu6gxrdJIXEWxQhUa3UqsXHWsDZ5LTAo/xU3zhjq9H3syCuFYDYKg==",
    	"signature": "K08yDiTEc094KoccOY+VYLQFxxQ="
    }
  • The decrypted JSON string in the request body follows this format:
    {
    	"username": "zhangsan",
    	"name": "Tom",
    	"mobile": "1899876....",
    	"email": "zhangsan@test.com",
    	"organizationId": "391551e8-160f-4993-8177-e7b9c5f6....",
    	"extAttr1": "value",
    	"extAttr2": "value"
    }

Example Response

Status code: 200

Request successful.

  • Response example with message signature and encryption enabled:
    {
    	"code": "200",
    	"message": "success",
    	"data": "P+rXpWetRg7IP0vdhVgkVwSoZBJeQwY2zhROsJq/HJ+q6tp1qhl9L1+c"
    }
  • The decrypted JSON string in the response body follows this format:
    {
    	"id": "c3a26dd3-27a0-4dec-a2ac-ce211e10...."
    }