1 Overview

Please follow the following rules and combine the actual environment of OA, assemble the Api to call the complete path and initiate the request.

Full path example: http://127.0.0.1:8010/eoffice/server/public/api/open-api/get-token

Token Validatiion

OPTIONS {eoffice addreee}eoffice/server/public/{api_url}

For APIs that require token verification, it is necessary to additionally pass the token verification from the header or pass the parameter through api_token; for the transfer method, refer to the following header and param parameter passing example.

Headers

NameTypeDescription

Authorization*

String

Pass the api_token, which is the unique token for accessing the api, and splice 'Bearer' in front of the api_token as shown in the example

Request Body

NameTypeDescription

api_token

String

A unique token for accessing the api

Get token

POST api/open-api/get-token

In the [Integration ] [Open Platform] menu, create a new application, enter the application details through the edit button, and obtain the AgentId and Secret of this application as the input parameters of this interface;

The token returned by this route is a required parameter for subsequent route requests.

Request Body

NameTypeDescription

agent_id*

string

The value of the AgentId field on an application details page in the open platform menu

secret*

string

In the open platform menu, on an application details page, the value of the Secret field

user*

string

User identity information identification basis; according to the "user identification field" configured by an application, a dynamic value is passed in, associated with the OA user, and a token corresponding to the user is generated

local

string

Multilingual encoding; please pass in the internationalization management module, the encoding of the effective language pack in the language pack list

Field

Type

Description

user

string

User ID

refresh_token

string

refresh_token

token

string

Authentication token for accessing the api

expired_in

string

The valid time of the verification token for accessing the API (unit: second)

refresh_token_expired_in

string

refresh_token valid time (unit: second)

List API

GET {api_list_url}

The common parameters that need to be passed by the list API are as follows param.

Request Body

NameTypeDescription

PAGE

int

The number of pages to be paginated (when page is passed 0, it means no paging)

limit

int

Items per page

order_by

array

sort arry

{
 "total":10,
 "list":[
     {"user_id":"admin","user_name":"Sysadmin", ...},
     {"user_id":"admin1","user_name":"Syadmin1", ...},
     ...
 ]
}

Request to return public section GET

GET {api_url}

Field

Type

Description

status

int

return success status

data

Object

return value

Custom Query Criteria

GET {api_url}

Headers

NameTypeDescription

search

json

Query conditions, custom fields Freely configure query conditions according to the form modeling field list

{ "search": { "field_1": [ 1, "=" ], "field_2": [ [ 1, 2 ], "in" ], "field_3": [ "name", "like" ], "field_4": [ [ "2020-01-01", "2020-12-30" ], "between" ] } }

pass in refresh_token to refresh the token

POST api/open-api/refresh-token

Request Body

NameTypeDescription

token*

string

Authentication token for accessing the api

refresh_token*

string

Get the refresh_token returned by the token interface

Field

Type

Description

token

string

Authentication token for accessing the api

expired_in

string

The valid time of the verification token for accessing the API (unit: second)

Get the user information corresponding to the token and refresh the token

GET api/auth/login-info/refresh

Request Body

NameTypeDescription

token*

string

Authentication token for accessing the api

refresh_new_token

string

By default, only the user information corresponding to the current token is returned; if "true" is passed in, a new token will be generated and returned

Field

Type

Description

current_user

string

User information corresponding to the current token

token

string

If the refresh parameter is passed in, the new token is returned here, otherwise, the original token is returned with a refresh_token

Last updated