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

Modifying a User Event

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

URL

POST https://{app_domain}/callback

Request Header

Authorization: Bearer {access_token}

Request Parameters

Table 1 Request parameters

Parameter

Fixed

Type

Description

id

Yes

String(50)

User ID of an enterprise application.

username

Yes

String(100)

Username.

name

No

String(40)

Real name of the user.

firstName

No

String(20)

Name.

middleName

No

String(20)

Middle name.

lastName

No

String(20)

Last name.

organizationId

No

String

Organization ID.

mobile

No

String

Mobile phone number.

email

No

String

Email address.

disabled

Yes

Boolean

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

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)

  • The value is the same as the value of ID in Table 1.
  • User ID sent back to OneAccess after the downstream enterprise application updates the user.
  • 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": 15093849585,
    	"eventType": "UPDATE_USER",
    	"data": "6lu6gxrHydJIXEQhUa3UqsXHWsDZ5LTAo/xU3zhjq9H3syCuFYDYKg==",
    	"signature": "K08yDiTEc094KoccOY+VYLQFxxQ="
    }
  • The decrypted JSON string in the request body follows this format:
    Update the user information based on the user ID in the request and send the updated attributes to the enterprise application.
    {
    	"id": "c3a26dd3-27a0-4dec-a2ac-ce211e10....",
    	"username": "zhangs",
    	"name": "Tom 2",
    	"mobile": "1867237....",
    	"email": "454205....@qq.com",
    	"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-ce211e105f97"
    }