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

Adding an Organization Event

This API is used to synchronize new organizations 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 organization attributes configured by enterprises. The administrator can set which attributes to synchronize with the target application by referring to 8.

Table 1 Request parameters

Parameter

Fixed

Type

Description

code

Yes

String(100)

Organization ID, which is globally unique.

name

Yes

String(40)

Organization name, which must be unique at the current level.

parentId

No

String(50)

Parent organization ID.

Response Parameters

Table 2 Response parameter

Parameter

Type

Description

id

String(50)

  • Organization ID generated after an organization is created for a downstream enterprise application. The ID is sent back to OneAccess as the unique identifier of the organization.
  • When an organization 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": 15093849585,
    	"eventType": "CREATE_ORGANIZATION",
    	"data": "6lu6gxrHydJIXEWxQhUa3UqsWsDZ5LTAo/xU3zhjq9H3syCuFYDYKg==",
    	"signature": "K08yDiTEc094KoccOY+VYLQFxxQ="
    }
  • The decrypted JSON string in the request body follows this format:
    {
    	"code": "1000003",
    	"name": "Wuhan branch",
    	"parentId": "5b183439-36a8-4d08-94ba-61b3c8d40b66"
    }

Example Response

Status code: 200

Request successful.

  • Response example with message signature and encryption enabled:
    {
    	"code": "200",
    	"message": "success",
    	"data": "j3rRBbc1Q1z1lZM0DDcUGFyaazO3NgnMbgK6UeWT35Druf5zyXg="
    }
  • The decrypted JSON string in the response body follows this format:
    {
    	"id": "6c5bb468-14b2-4183-baf2-06d523e03bd3"
    }