Updated on 2025-03-31 GMT+08:00

C6 OIAP AppCube Interface Authentication

Description

When the OIAP provides interfaces for AppCube access, the token obtaining interface needs to be invoked to obtain a token and the validity period of the token for subsequent business interface invocation. If the token expires, the interface for obtaining the token needs to be invoked again.

Interface Method

This interface supports only the POST method and does not support PUT, GET, DELETE, or other methods.

URI

https://IP:PORT/oifde/rest/appcube/api/getAppCubeToken

Request

Table 1 Parameter in the request header

No.

Parameter

Type

Mandatory

Description

1

Content-Type

String

Yes

The value is fixed at application/json; charset=UTF-8.

Table 2 Parameters in the request body

Parameter

Type

Location

Mandatory

Description

appKey

String

body

Yes

App key. The value is the tenant ID.

appSecret

String

body

Yes

App key, which must be agreed by both parties and can be dynamically changed.

How do I obtain appKey and appSecret?

  1. If AppCube needs to be interconnected, obtain a token using the tenant ID and invoke the interface within the token validity period. The obtained token must be transferred for each interface invocation. The request body of the interface must contain authToken.
    • Set appKey to the tenant ID. After signing in to the tenant space, you can use the browser development tool to view cookies and obtain the value of TenantId.
    • Set appSecret to the value of API Password on the API Password Settings tab page on System Management > System Configuration page in the IVR.

Response

Parameter

Type

Location

Mandatory

Description

errorCode

int

body

Yes

Error code.

  • 0: success
  • Values other than 0: failure

    The status code 200 also indicates success.

errorMsg

String

body

No

Error description.

authToken

String

body

Yes

Authentication token.

expireTime

int

body

No

Token validity period, in seconds. The default value is 3600.

If the error code is not 0, no value is returned.

Message Example

  • Request body
    {
       "appKey": "tenant001",
       "appSecret": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" 
    }
  • Response body
    {
        "errorCode" : 0, // Error code, which is an integer. If no error is reported, the value is 0.
        "errorMsg" : "", // Error message, which is a string. If no error is reported, this parameter is left empty.
        "authToken": "2************************", 
        "expireTime" : 3600
    }