Help Center/ KooDrive/ API Reference/ API/ Other APIs/ Obtain the JavaScript SDK.
Updated on 2024-12-24 GMT+08:00

Obtain the JavaScript SDK.

Function

Obtain the JavaScript SDK.

URI

GET /koodrive/ose/v1/sdk/get-js-sdk-info

Request Parameters

Table 1 Request header parameters

Parameter

Mandatory

Type

Description

Authorization

Yes

String

Access token. Token authentication is used to call KooDrive APIs. A token indicates the permission. When an API is called, the token is added to the request header to obtain the operation permission. For details about how to obtain an access token, see the corresponding developer guide. The format is Bearer+{access_token}.

X-Traceid

No

String

Message log trace ID. The value contains 58 bits.

Response Parameters

Status code: 200

Table 2 Response body parameters

Parameter

Type

Description

code

Integer

Response code.

msg

String

Response information.

data

JsSdkData object

JavaScript SDK information.

Table 3 JsSdkData

Parameter

Type

Description

page_token_key

String

Parameter returned by the backend API.

page_token

String

Parameter returned by the backend API.

js_sdk_url

String

JavaScript SDK address.

retry_js_sdk_url

String

JavaScript SDK address.

transaction_id

String

Transaction ID.

orgid_config

String

Parameter returned by the backend API. The value must be a JSON string. sdk_auth_code can be used only once. The backend must obtain it again for each initialization.

Example Requests

Obtain the JavaScript SDK.

GET /koodrive/ose/sdk/get-js-sdk-info

Authorization:Bearer+10f88**********4791e9f

Example Responses

Status code: 200

Obtain the JavaScript SDK response.

{
  "data" : {
    "page_token_key" : "1724663471194",
    "page_token" : "752**************************2aa",
    "js_sdk_url" : "https://orgid-beta.ulanqab.huawei.com/orgid/console-web/jssdk/jssdk.umd.js",
    "retry_js_sdk_url" : "https://orgid-beta.ulanqab.huawei.com/orgid/console-web/jssdk/jssdk.umd.js",
    "transaction_id" : "1724663471194",
    "orgid_config" : "{\"sdk_auth_code\":\"043********************5e1\",\"organization_source\":\"HUAWEI_ID\"}"
  },
  "code" : 0,
  "msg" : "Successful."
}

Status Codes

Status Code

Description

200

Obtain the JavaScript SDK response.