e-office User Manual
  • Overview
    • Chinese Online User Manual
    • e-Office Training Video
  • Server
    • 1 Preparation
    • 2 Installation
    • 3 License
    • 4 FAQ
    • 5 Service Management Platform
  • Mobile APP
    • 1 Preparation
    • 2 Installation
    • 3 Configuration
  • Quick Start Guideline
  • Design a new workflow
    • 1 New Form - Leave Application
    • 2 New workflow-Leave Application
    • 3 Initialize new leave application
    • 4 Regular Expressions(Regex) in Field validation
  • App Studio - New Application
    • 1 New application - Customer Management
    • 2 Approval flow
    • 3 User Menu
    • 4 All the controls
  • Open API
    • 1 Overview
    • 2 Attachment
    • 3 User Management
  • Customisation
  • Expense
    • My expenses
    • Expense List
    • Enter expense
    • Budget Statistics
    • Setting
      • Budget
      • Permission
        • Expense List
        • Budget Statistics
        • Expense Category
      • Basic Settings
      • Expense category
    • Expense Report
  • Project
    • My project
      • Project Details
    • New project
    • Project Task
    • Report Management
    • Settings
  • CRM
    • CRM Homepage
    • New Customer
    • Details
      • Customer List
        • List Data
        • Data Operation
        • Customer Detail
      • Contact
      • Contact Log
      • Opportunity
      • Sales Record
      • Contracts
      • Customer Pool
        • Pools I Managed
        • Pools I Joined
        • Pool Configuration
    • Suppliers
    • Product
    • More
      • Import/Export
      • Transfer
      • Merge
      • Recycle Bin
      • Request to access
      • Permission Approval
    • Customer Report
    • Settings
      • Field Settings
      • Homepage Configuration
      • Pool Configuration
      • Permission Setting
      • Related Business Setting
  • Assets
    • New asset
    • Application for use ~ WIP
    • Application for approval
    • Changes
    • Maintenance
    • Asset inventory ~ WIP
    • Return of assets ~ WIP
    • Analysis ~ WIP
    • Settings ~ WIP
  • Leave
    • My Leave
    • Leave List
    • Leave Type
    • Leave Setting
  • Attendance ~ WIP
Powered by GitBook
On this page
  • Token Validatiion
  • Get token
  • List API
  • Request to return public section GET
  • Custom Query Criteria
  • pass in refresh_token to refresh the token
  • Get the user information corresponding to the token and refresh the token
  1. Open API

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

Name
Type
Description

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

Name
Type
Description

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

Name
Type
Description

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)

{
    "status": 1,
    "data": {
        "token": "7d4bd6736c8f29b70126c9e5984c7239bcd51fdd031e...",
        "user": "admin",
        "refresh_token": "6d53dbb78499978d6c840ecfaf70b19864f14a...",
        "expired_in": 3600,
        "refresh_token_expired_in": 7200
    },
    "runtime": "0.245"
}

List API

GET {api_list_url}

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

Request Body

Name
Type
Description

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", ...},
     ...
 ]
}
[
     {"user_id":"admin","user_name":"Sysadmin", ...},
     {"user_id":"admin1","user_name":"Sysadmin1", ...},
     ...
 ]

Request to return public section GET

GET {api_url}

Field

Type

Description

status

int

return success status

data

Object

return value

{
 "status":1,//successful status
 "data":{
     ...
 }//return value
}
{
    "status": 1
}

Name

Type

Description

status

int

return failure status

errors

array

return failure message

{
  "status":0,//failure status
  "errors":[
     {
         "code": "0x003024",//error code
         "message": "该用户未开启动态令牌验证"//error message
     }
  ]
}
{
  "status":0,//Failure status
}

Custom Query Criteria

GET {api_url}

Headers

Name
Type
Description

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

Name
Type
Description

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)

{
    "status": 1,
    "data": {
        "token": "5925324b80604039d394c1451abff4ccd0eb4fd400de...",
        "expired_in": 3600
    },
    "runtime": "0.245"
}

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

GET api/auth/login-info/refresh

Request Body

Name
Type
Description

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

{
  "status": 1,
  "data": {
      "current_user": {
          "user_id": "admin", // User ID
          "user_name": "System Admin", // username
          "user_accounts": "admin", // user system account
          "dept_id": 2, // Department ID
          "dept_name": "IT Department", // Department Name
          "phone_number": "15601931531", // Mobile
          ...
      },
      ...
      "token": "5f3a3be8d1e89f5d97c2f0f3d917dfb3dd916a424057...",
      "refresh_token": true
  },
  "runtime": "0.750"
}

Last updated 10 months ago