Open API GapoWork - Workspace Admin API key (2.0.0-oas3)

Download OpenAPI specification:

Hỗ trợ GapoWork: [email protected]

Giới thiệu

Khái niệm chung

  • Tổ chức (Workspace): Là môi trường làm việc của một tổ chức doanh nghiệp trên GapoWork

  • Người dùng (User): Là các cá nhân, tổ chức sử dụng hệ thống GapoWork thông qua giao diện GapoWork (Web hoặc ứng dụng trên các thiết bị di dộng) hoặc thông qua Open API. Người dùng được chia làm các vai trò (Role):

    • Quản trị viên tổ chức (Workspace Admin): Là nhóm người dùng được cấp quyền quản trị, có vai trò quản lý người dùng thông thường và các thiết lập tính năng của Workspace đồng thời có thể sử dụng các tính năng này như một người dùng thông thường
    • Người dùng thông thường (Normal User): Là nhóm người dùng còn lại, không được cấp quyền quản lý trên Workspace và chỉ có thể sử dụng các tính năng của Workspace
  • API key (Token): Là phương thức xác thực cho phép User tương tác với GapoWork thông qua Open API. API key được truyền qua header của mỗi request với key "x-gapo-openapi-key". Mỗi nhóm người dùng sẽ được cấp những loại API key khác nhau:

    • Nhóm người dùng Workspace Admin: Workspace Admin API key (adminKey) và User API key (userKey)
    • Nhóm người dùng Normal User: User API key (userKey)
  • Quyền (Permission): Là quyền thực hiện một hành động nhất định trên hệ thống thông qua api. Permission được tích hợp trong API key, mỗi API key có thể đi kèm 1 hoặc nhiều quyền khác nhau và chỉ thực hiện được những hành động tương ứng với quyền được tích hợp

Đối tượng sử dụng tài liệu này

  • Đây là tài liệu dành cho người dùng Workspace Admin
  • Các API liệt kê trong tài liệu này tập trung vào các thiết lập tính năng và quản lý Workspace nên phải sử dụng adminKey để tương tác với hệ thống (trừ các Auth API)

Làm sao để có adminKey

  • Sử dụng giao diện để lấy adminKey (Đang cập nhật)
  • Liên hệ đến đội hỗ trợ của GapoWork

Các quyền có thể được tích hợp trong adminKey

  • (create:token) Tạo API key: Workspace Admin có thể tạo thêm các API key cho người dùng trong Workspace (đang cập nhật)

  • (read:list_token) Lấy danh sách API key: Workspace Admin có thể xem danh sách các API key đang có trên Workspace của mình

  • (deactivate:token) Vô hiệu hóa API key: Workspace Admin có thể vô hiệu hóa các API key đang hoạt động trên Workspace

  • (activate:token) Kích hoạt lại API key: Workspace Admin có thể kích hoạt lại API key đã bị vô hiệu hóa trước đó

  • (delete:token) Xóa API key: Workspace Admin có thể xóa vĩnh viển API key đang có trên Workspace

  • (invite:User) Mời User vào Workspace: Workspace Admin có thể mời User (đã có hoặc chưa có tài khoản GapoWork) tham gia vào Workspace

  • (deactivate:User) Vô hiệu hóa tài khoản người dùng: Workspace Admin có thể vô hiệu hóa tài khoản người dùng thuộc Workspace

  • (activate:User) Tái kích họa tài khoản người dùng: Workspace Admin có thể kích hoạt lại tài khoản người dùng đã bị vô hiệu hóa trước đó

  • (upgrade:user_account) Nâng cấp tài khoản người dùng: Workspace Admin có thể nâng cấp tài khoản người dùng trong Workspace của mình lên các gói Premium/Business sau khi đã kí hợp đồng với GapoWork

  • (downgrade:user_account) Hạ cấp tài khoản người dùng: Workspace Admin có thể hạ cấp tài khoản người dùng Premium/Business trong Workspace của mình về tài khoản thường

  • (update:user_info) Cập nhật thông tin tài khoản người dùng: Workspace Admin có thể cập nhật các thông tin hiển thị trên tài khoản người dùng trừ thông tin đăng nhập

  • (create:department) Thêm phòng ban mới: Workspace Admin có thể thêm Phòng Ban mới trên Workspace

  • (read:list_department) Lấy danh sách phòng ban: Workspace Admin có thể xem danh sách Phòng Ban hiện có trên Workspace

  • (update:department) Cập nhật phòng ban: Workspace Admin có thể cập nhật thông tin Phòng Ban trên Workspace

  • (delete:department) Xóa phòng ban: Workspace Admin có thể xóa vĩnh viễn một Phòng Ban trên Workspace

  • (create:role) Thêm chức vụ mới: Workspace Admin có thể thêm Chức Vụ mới trên Workspace

  • (read:list_role) Lấy danh sách chức vụ: Workspace Admin có thể lấy danh sách các Chức Vụ đang có trên Workspace

  • (update:role) Cập nhật chức vụ: Workspace Admin có thể cập nhật thông tin Chức Vụ trên Workspace

  • (delete:role) Xóa chức vụ: Workspace Admin có thể xóa vĩnh viễn một Chức Vụ trên Workspace

  • (create:chat_bot) Thêm chat bot: Workspace Admin có thể tạo chat bot mới hoạt động trên Workspace

  • (read:list_chat_bot) Lấy danh sách chat bot: Workspace Admin có thế lấy danh sách các chat bot đã tạo trên Workspace

  • (read:bot_info) Lấy thông tin từ chat bot: Workspace Admin có thể xem thông tin chi tiết của chat bot

  • (update:chat_bot) Cập nhật thông tin chat bot: Workspace Admin có thể cập nhật thông tin tên và ảnh đại diện của chat bot trên Workspace

  • (delete:chat_bot) Xóa chat bot: Workspace Admin có thể xóa vĩnh viễn chat bot đang có trên Workspace

  • (create:bot_command) Thêm command cho chat bot: Workspace Admin có thể cấu hình thêm command cho chat bot

  • (read:list_bot_command) Lấy danh sách command của chat bot: Workspace Admin có thể lấy danh sách các command đã được thiết lập của một chat bot cụ thể

  • (update:bot_command) Cập nhật command của chat bot: Workspace Admin có thể cập nhật mô tả và câu trả lời của command

  • (delete:bot_command) Xóa commnad của chat bot: Workspace Admin có thể xóa vĩ viễn một command bất kì được thiết lập trước đó của chat bot

  • (read:list_post) Lấy danh sách bài viết: Workspace Admin có thể lấy danh sách các bài viết đang có trên Workspace

  • (query:user_info) Lấy User ID: Workspace Admin có thể dùng thông tin đăng nhập để lấy id tài khoản người dùng

  • (create:survey) Tạo khảo sát: Workspace Admin có thể tạo khảo sát mới cho workspace

  • (update:survey) Cập nhật khảo sát: Workspace Admin có thể cập nhật thông tin khảo sát đã tồn tại

  • (export:survey_answer) Xuất kết quả khảo sát: Workspace Admin có thể xuất kết quả khảo sát dưới dạng file

  • (read:survey) Xem khảo sát: Workspace Admin có thể xem chi tiết thông tin khảo sát

  • (create:survey_template) Tạo mẫu khảo sát: Workspace Admin có thể tạo mẫu khảo sát để tái sử dụng

  • (read:survey_template) Xem mẫu khảo sát: Workspace Admin có thể xem danh sách và chi tiết mẫu khảo sát

  • (update:survey_template) Cập nhật mẫu khảo sát: Workspace Admin có thể chỉnh sửa mẫu khảo sát

  • (remind:survey) Nhắc nhở khảo sát: Workspace Admin có thể gửi nhắc nhở đến những người chưa trả lời khảo sát

  • (sudo:workspace) Quyền SUDO: Quyền SUDO có thể thay thế tất cả các quyền còn lại và cả các quyền có thể được thêm trong tương lai

Các thắc mắc khi sử dụng tài liệu này vui lòng liên hệ bộ phận hỗ trợ của GapoWork để được hỗ trợ

Auth

Các API dùng để login vào hệ thống GapoWork thông qua API và lấy API key

Kiểm tra email

Kiểm tra email đã tồn tại trong workspace hay chưa.

Authorizations:
adminKey
header Parameters
x-gapo-openapi-key
required
string
Example: workspace - xxxxxxxx

Workspace Admin API Key

content-type
string
Example: application/json
Request Body schema: application/json
required
email
required
string [ 1 .. 50 ] characters

Email dùng để đăng nhập

Responses

Request samples

Content type
application/json
{}

Response samples

Content type
application/json
{
  • "data": {
    },
  • "message": "successful",
  • "code": 200
}

Lấy API key

Lấy danh sách API key đang có của User hoặc trả về API key mặc định tương ứng bằng access_token nhận được từ API login

Authorizations:
bearer
header Parameters
x-gapo-workspace-id
required
string
Example: 523866125265220

WorkspaceID

Authorization
required
string
Example: Bearer <jwt token>

Responses

Response samples

Content type
application/json
{
  • "message": "Succeeded!",
  • "data": [
    ]
}

API key

Các API dùng để tạo và quản lý API key

Lấy danh sách API key

Yêu cầu permission: read:list_token

Trường hợp sử dụng:

  • Lấy danh sách các API key đang có trên Workspace (đang hoạt động và đã bị vô hiệu hóa)
Authorizations:
adminKey
header Parameters
x-gapo-openapi-key
required
string
Example: workspace - xxxxxxxx

Workspace Admin API key

Responses

Response samples

Content type
application/json
{
  • "message": "Succeeded!",
  • "data": [
    ],
  • "links": {
    }
}

Tạo API key mới

Yêu cầu permission: create:token

Trường hợp thường dùng:

  • Workspace Admin tạo adminKey mới để ủy quyền cho IT hoặc người khác dùng
  • Workspace Admin tạo userKey để dùng các API cần có userKey

Note:

  • Một Workspace Admin c thể tạo 1 hoặc nhiều API key khác nhau cho
  • Hệ thống sẽ ghi nhận người thực hiện hành động thông qua user_id dùng khi tạo API key nên không đưa API key tạo từ user_id của mình cho người khác khi không thật sự cần thiết
Authorizations:
adminKey
header Parameters
content-type
string
Example: application/json
x-gapo-openapi-key
required
string
Example: workspace - xxxxxxxx

Workspace Admin API key

Request Body schema: application/json
title
required
string

Tên phân biệt cho API key mới

role_type
required
string
Enum: "user" "workspace"

Loại API key cần tạo

creator_id
number

Đại diện cho người dùng sẽ sử dụng API key này, bỏ qua trường nay nếu muốn tạo API key mới cho bản thân

Responses

Request samples

Content type
application/json
{
  • "title": "API key của A",
  • "role_type": "user",
  • "creator_id": 123456789
}

Response samples

Content type
application/json
{
  • "message": "Succeeded!",
  • "data": {
    }
}

Xóa API key

Yêu cầu permission: delete:token

Trường hợp sử dụng:

  • Workspace Admin xóa vĩnh viễn một API key đang có trên hệ thống
Authorizations:
adminKey
query Parameters
token_id
required
string
Example: token_id=18791f2208f838e95f41b001

Id của API key cần xóa

header Parameters
x-gapo-openapi-key
required
string
Example: workspace - xxxxxxxx

Workspace Admin API key

Responses

Response samples

Content type
application/json
{
  • "message": "Succeeded!"
}

Update API key

Yêu cầu permission: update:token

Trường hợp sử dụng:

  • Workspace Admin update tên phân biệt của API key
Authorizations:
adminKey
query Parameters
token_id
required
string
Example: token_id=39f5050065d2484582c673ec3c41e213

ID của API key cần update

header Parameters
content-type
string
Example: application/json
x-gapo-openapi-key
required
string
Example: workspace - xxxxxxxx

Workspace Admin key

Request Body schema: application/json
title
required
string

Responses

Request samples

Content type
application/json
{
  • "title": "Tên phân biệt mới"
}

Response samples

Content type
application/json
{
  • "message": "Succeeded!"
}

Vô hiệu hóa API key

Yêu cầu permission: deactivate:token

Trường hợp sử dụng:

  • Workspace Admin vô hiệu hóa API key không cần dùng nữa
Authorizations:
adminKey
query Parameters
token_id
required
string
Example: token_id=39f5050065d2484582c673ec3c41e213

ID của API key cần update

header Parameters
x-gapo-openapi-key
required
string
Example: workspace - xxxxxxxx

Workspace Admin key

Responses

Response samples

Content type
application/json
{
  • "message": "Succeeded!"
}

Kích hoạt lại API key

Yêu cầu permission: activate:token

Trường hợp sử dụng:

  • Workspace Admin kích hoạt lại API đã bị vô hiệu hóa trước đó
Authorizations:
adminKey
query Parameters
token_id
required
string
Example: token_id=39f5050065d2484582c673ec3c41e213

ID của API key cần update

header Parameters
x-gapo-openapi-key
required
string
Example: workspace - xxxxxxxx

Workspace Admin key

Responses

Response samples

Content type
application/json
{
  • "message": "Succeeded!"
}

User

Các API dùng để mời và quản lý tài khoản người dùng

Mời User tham gia workspace

Yêu cầu permission: invite:user

Trường hợp thường dùng:

  • Workspace Admin mời một User mới tham gia GapoWork và thêm User vào workspace
  • Workspace Admin mời một User đã có tài khoản GapoWork tham gia vào workspace
  • Tự động thêm User mới vào Workspace khi có nhân sự mới được đăng kí trên hệ thống riêng của doanh nghiệp
  • Thêm số lượng lớn người dùng từ data có sẵn mà không mất nhiều thời gian thao tác thủ công trên giao diện GapoWork

Note:

  • Phải cung cấp ít nhất một trong 3 trường email, phone_number hoặc identifier_code để mời User
  • Nếu dùng identifier_code thì trường password được dùng làm mật khẩu của tài khoản, nếu không cung cấp password thì sẽ lấy identifier_code làm password
  • Nếu dùng email hoặc phone_number thì trường password không có tác dụng, sẽ bị bỏ qua, khi User vào đường dẫn nhận được qua email/sms có thể tự tạo password mới
  • Trường title có hiệu lựu nếu trường departments có giá trị
Authorizations:
adminKey
header Parameters
content-type
string
Example: application/json
x-gapo-openapi-key
required
string
Example: workspace - xxxxxxxx

Workspace Admin API key

Request Body schema: application/json
email
string

Email tài khoản người dùng, nếu không có thì điền ""

phone_number
string

Số điện thoại liên kết với tài khoản, nếu không có thì điền ""

identifier_code
string

Mã số nhân viên của người dùng, nếu không có thì điền ""

display_name
string

Tên hiển thị của tài khoản

department_id
string

Id phòng ban

role_id
string

Id chức vụ

password
string

Mật khẩu ban đầu của tài khoản

Array of objects

Thông tin phòng ban chức vụ của tài khoản

Array of objects

Các trường thông tin tùy chỉnh cần cập nhật

employee_code
string

Mã nhân viên của người dùng

region_id
string

ID của vùng miền

department
string

Vui lòng điền thông tin các cấp phòng ban theo đúng thứ tự cấp độ để hệ thống tự động tạo phòng ban và sơ đồ tổ chức. Các phòng ban theo các cấp cần ngăn cách nhau bằng " || "

title
string

Tên chức vụ. Trường này có hiệu lưu khi trường department được truyền

check_department_role
boolean

Hệ thống sẽ kiểm tra theo từng cấp độ phòng ban theo tên

  • true: Chỉ chấp nhận phòng ban đã tồn tại
  • false: Tạo phòng ban nếu chưa tồn tại
contract_type
string

Loại hợp đồng

first_day_of_work
number

Ngày vào công ty. Là giá trị timestamps in milliseconds

first_official_contract_signing_date
number

Ngày ký hợp đồng chính thức đầu tiên. Là giá trị timestamps in milliseconds

last_day_of_work
number

Ngày nghỉ việc. Là giá trị timestamps in milliseconds

object

Ngày sinh

manager_id
number

Id của cấp trên quản lý trực tiếp

Responses

Request samples

Content type
application/json
{
  • "email": "",
  • "phone_number": "",
  • "identifier_code": "51363324",
  • "display_name": "Trần Văn A",
  • "department_id": "a89afe3b231847169817225b316cbc18",
  • "role_id": "a0d3b0c5d3934cb894429d493a20a76c",
  • "password": "TranV@nA3324",
  • "list_departments": [
    ],
  • "custom_info": [
    ],
  • "employee_code": "string",
  • "region_id": "string",
  • "department": "Chi nhánh Hà Nội || Phòng Tài chính Kế toán || Kế toán",
  • "title": "Kế toán trưởng",
  • "check_department_role": true,
  • "contract_type": "string",
  • "first_day_of_work": 0,
  • "first_official_contract_signing_date": 0,
  • "last_day_of_work": 0,
  • "birthday": {
    },
  • "manager_id": 0
}

Response samples

Content type
application/json
{
  • "message": "Succeeded!",
  • "data": {
    }
}

Cập nhật thông tin người dùng

Yêu cầu permission: update:user_info

Trường hợp thường dùng:

  • Workspace Admin cập nhật thông tin hiển thị của người dùng
  • Workspace Admin di chuyển người dùng giữa các phòng ban trong workspace
  • Workspace Admin cập nhật chức vụ của người dùng trên workspace
  • Workspace Admin bổ sung các thông tin custom của mình cho tài khoản người dùng

Note:

  • Người dùng được xác định thông qua một trong 4 thông tin: user_id, email, phone_number hoặc identifier_code để cập nhật User
  • Các thông tin đăng nhập của người dùng không thể được cập nhật qua API này
Authorizations:
adminKey
query Parameters
user_id
string
Example: user_id=184632584

Id tài khoản người dùng

phone_number
string
Example: phone_number=0123456789

Số điện thoại đăng nhập của người dùng

email
string

Email đăng nhập của người dùng

identifier_code
string
Example: identifier_code=134512346717

Mã định danh đăng nhập của người dùng

header Parameters
content-type
string
Example: application/json
x-gapo-openapi-key
required
string
Example: workspace - xxxxxxxx

Workspace Admin API key

Request Body schema: application/json
tree_id
string

ID của cây tổ chức

user_id
number

ID của người dùng

display_name
string

Tên hiển thị của người dùng

email
string

Email hiển thị trên tài khoản. Có thể thay đổi nếu không phải là thông tin đăng nhập

phone_number
string

Số điện thoại hiển thị trên tài khoản. Có thể thay đổi nếu không phải là thông tin đăng nhập

Array of objects

Thông tin phòng ban và chức vụ của tài khoản

Array of objects

Các trường thông tin tùy chỉnh cần cập nhật

employee_code
string

Mã nhân viên của người dùng

department
string

Thông tin các cấp phòng ban theo thứ tự cấp độ, ngăn cách nhau bằng " || "

region_id
string

ID của vùng miền

title
string

Chức danh của người dùng

contract_type
string

Loại hợp đồng

first_day_of_work
number

Ngày vào công ty. Là giá trị timestamps in milliseconds

first_official_contract_signing_date
number

Ngày ký hợp đồng chính thức đầu tiên. Là giá trị timestamps in milliseconds

last_day_of_work
number

Ngày nghỉ việc. Là giá trị timestamps in milliseconds

object

Ngày sinh

manager_id
number

Id của cấp trên quản lý trực tiếp

Responses

Request samples

Content type
application/json
{
  • "tree_id": "string",
  • "user_id": 0,
  • "display_name": "string",
  • "email": "string",
  • "phone_number": "string",
  • "list_departments": [
    ],
  • "custom_info": [
    ],
  • "employee_code": "string",
  • "department": "string",
  • "region_id": "string",
  • "title": "string",
  • "contract_type": "string",
  • "first_day_of_work": 0,
  • "first_official_contract_signing_date": 0,
  • "last_day_of_work": 0,
  • "birthday": {
    },
  • "manager_id": 0
}

Response samples

Content type
application/json
{
  • "message": "Succeeded!"
}

Upgrade tài khoản cho User

Yêu cầu permission: upgrade:user_account

Trường hợp sử dụng:

  • Workspace Admin nâng cấp tài khoản User thành tài khoản Business/Premium

Note:

  • Khi nâng cấp một tài khoản thành Business hay Premium sẽ phát sinh phí trong chu kì thanh toán tiếp theo
  • Để nâng cấp một tài khoản Free thành Enterprise vui lòng liên hệ bộ chận chăm sóc khách hàng
Authorizations:
adminKey
query Parameters
user_id
required
string
Example: user_id=162463473

Id tài khoản được upgrade

header Parameters
x-gapo-openapi-key
required
string
Example: workspace - xxxxxxxx

Workspace Admin API key

Request Body schema: application/json
account_type
number
Enum: 1 2

Gói tài khoản mục tiêu để nâng cấp

  • 1:Premium - 2:Business

Responses

Request samples

Content type
application/json
{
  • "account_type": 1
}

Response samples

Content type
application/json
{
  • "message": "Succeeded!"
}

Downgrade tài khoản cho User

Yêu cầu permission: downgrade:user

Trường hợp sử dụng:

  • Workspace Admin chuyển tài khoản Business/Premium về tài khoản Free

Note: Khi chuyển tài khoản Business/Premium thành tài khoản Free phụ lục sẽ được cập nhật trong chu kì thanh toán tiếp theo

Authorizations:
adminKey
query Parameters
user_id
required
number
Example: user_id=162463473

Id tài khoản cần downgrade

header Parameters
x-gapo-openapi-key
required
string
Example: workspace - xxxxxxxx

Workspace Admin API key

Responses

Response samples

Content type
application/json
{
  • "message": "Succeeded!"
}

Kích hoạt tài khoản người dùng

Yêu cầu permission: activate:user

Trường hợp sử dụng:

  • Workspace Admin kích hoạt lại tài khoản người dùng đã bị vô hiệu hóa trước đó
  • Thích hợp để sử dụng với mục dích quản lý lượng lớn người dùng workspace cùng lúc

Note:

  • Phải cung cấp ít nhất một trong các thông tin: user_id, email, phone_number, identifier_code của tài khoản người dùng
Authorizations:
adminKey
query Parameters
user_id
required
number
Example: user_id=30889369

ID Người dùng

email
string

Email người dùng

phone_number
string
Example: phone_number=84123456789

Số điện thoại người dùng.

Số điện thoại phải bắt đầu bằng 84

identifier_code
string
Example: identifier_code=1

Mã định danh người dùng

header Parameters
x-gapo-openapi-key
required
string
Example: workspace - xxxxxxxx

Workspace Admin API key

Responses

Response samples

Content type
application/json
{
  • "message": "Succeeded!"
}

Vô hiệu hóa tài khoản người dùng

Yêu cầu permission: deactivate:user

Trường hợp sử dụng:

  • Workspace Admin vô hiệu hóa tài khoản người dùng
  • Thích hợp để sử dụng với mục dích quản lý lượng lớn người dùng workspace cùng lúc

Note:

  • Phải cung cấp ít nhật một trong các thông tin: user_id, email, phone_number, identifier_code của tài khoản người dùng
Authorizations:
adminKey
query Parameters
user_id
required
number
Example: user_id=30889369

Id tài khoản

email
string

Email của tài khoản

phone_number
string
Example: phone_number=84123456789

Số điện thoại người dùng.

Số điện thoại phải bắt đầu bằng 84

identifier_code
string
Example: identifier_code=1

Mã định danh người dùng

header Parameters
x-gapo-openapi-key
required
string
Example: workspace - xxxxxxxx

Workspace Admin API key

Responses

Response samples

Content type
application/json
{
  • "message": "Succeeded!"
}

Sơ đồ tổ chức

Các API liên quan đến sơ đồ tổ chức trong workspace

Thêm phòng ban mới

Yêu cầu permission: create:department

Trường hợp sử dụng:

  • Workspace Admin thêm các phòng ban mới cho workspace
Authorizations:
adminKey
header Parameters
content-type
string
Example: application/json
x-gapo-openapi-key
required
string
Example: workspace - xxxxxxxx

Workspace Admin API key

Request Body schema: application/json
tree_id
required
string

Id cây tổ chức, mặc định bằng workspace_id

parent_id
required
string

Id phòng ban cấp trên, nếu không có thì để ""

required
Array of objects (CreateDepartmentInfo)

Responses

Request samples

Content type
application/json
{
  • "tree_id": "584568543185435184",
  • "parent_id": "",
  • "departments": [
    ]
}

Response samples

Content type
application/json
{
  • "message": "Succeeded!"
}

Lấy danh sách phòng ban

Yêu cầu permission: read:list_department

Trường hợp sử dụng:

  • Workspace Admin lấy danh sách phòng ban có trên workspace
Authorizations:
adminKey
header Parameters
x-gapo-openapi-key
required
string
Example: workspace - xxxxxxxx

Workspace Admin API key

Responses

Response samples

Content type
application/json
{
  • "message": "Succeeded!",
  • "data": [
    ]
}

Cập nhật phòng ban

Yêu cầu permission: update:department

Trường hợp sử dụng:

  • Workspace Admin thay đổi tên phòng ban
  • Workspace Admin di chuyển phòng ban đến phòng ban cấp trên khác
Authorizations:
adminKey
query Parameters
department_id
required
string
Example: department_id=1256237fb1a7

Id phòng ban cần cập nhật

header Parameters
content-type
string
Example: application/json
x-gapo-openapi-key
required
string
Example: workspace - xxxxxxxx

Workspace Admin API key

Request Body schema: application/json
tree_id
string

Id cây sơ đồ tổ chức, mặc định để bằng workspace_id

name
string

Tên mới sau khi cập nhật

parent_id
string

Id phòng ban cấp trên hiện tại hoặc Id phòng ban muốn chuyển đến. Nếu là phòng ban cao nhất, không có parent thì có thể để ""

Responses

Request samples

Content type
application/json
{
  • "tree_id": "54816584316484318",
  • "name": "CSKH",
  • "parent_id": ""
}

Response samples

Content type
application/json
{
  • "message": "Succeeded!"
}

Xóa phòng ban

Yêu cầu permission: delete:department

Trường hợp sử dụng:

  • Workspace Admin xóa phòng ban khỏi workspace

Note:

  • Tác vụ này không thể được hoàn tác nên cần chú ý khi thực hiện
Authorizations:
adminKey
query Parameters
department_id
required
string
Example: department_id=1871325fb32

Id phòng ban muốn xóa

header Parameters
x-gapo-openapi-key
required
string
Example: workspace - xxxxxxxx

Workspace Admin API key

Responses

Response samples

Content type
application/json
{
  • "message": "Succeeded!"
}

Thêm chức vụ mới

Yêu cầu permission: create:role

Trường hợp sử dụng:

  • Workspace Admin thêm các chức vụ mới cho workspace
Authorizations:
adminKey
header Parameters
content-type
string
Example: application/json
x-gapo-openapi-key
required
string
Example: workspace - xxxxxxxx

Workspace Admin API key

Request Body schema: application/json
required
Array of objects

Danh sách các chức vụ muốn thêm

Responses

Request samples

Content type
application/json
{
  • "roles": [
    ]
}

Response samples

Content type
application/json
{
  • "message": "Succeeded!"
}

Lấy danh sách chức vụ

Yêu cầu permission: read:list_role

Trường hợp sử dụng:

  • Workspace Admin lấy danh sách chức vụ có trên workspace
Authorizations:
adminKey
header Parameters
x-gapo-openapi-key
required
string
Example: workspace - xxxxxxxx

Workspace Admin API key

Responses

Response samples

Content type
application/json
{
  • "message": "Succeeded!",
  • "data": [
    ]
}

Cập nhật chức vụ

Yêu cầu permission: update:role

Trường hợp sử dụng:

  • Workspace Admin thay đổi tên chức vụ
Authorizations:
adminKey
query Parameters
role_id
required
string
Example: role_id=1637fb1a7

Id chức vụ cần cập nhật

header Parameters
content-type
string
Example: application/json
x-gapo-openapi-key
required
string
Example: workspace - xxxxxxxx

Workspace Admin API key

Request Body schema: application/json
name
required
string

Tên mới sau khi cập nhật

Responses

Request samples

Content type
application/json
{
  • "name": "Nhân viên kinh doanh"
}

Response samples

Content type
application/json
{
  • "message": "Succeeded!"
}

Xóa chức vụ

Yêu cầu permission: delete:role

Trường hộp sử dụng:

  • Workspace Admin xóa chức vụ khỏi workspace

Note:

  • Tác vụ này không thể hoàn tác nên cần chú ý khi thực hiện
Authorizations:
adminKey
query Parameters
role_id
required
string
Example: role_id=1871325fb32

Id chức vụ muốn xóa

header Parameters
x-gapo-openapi-key
required
string
Example: workspace - xxxxxxxx

Workspace Admin API key

Responses

Response samples

Content type
application/json
{
  • "message": "Succeeded!"
}

Thêm hoặc xóa thành viên

Thêm hoặc xóa thành viên khỏi một quản lý cụ thể.

path Parameters
manager_id
required
string

ID của quản lý

Request Body schema: application/json
required
added_member_ids
Array of numbers
removed_member_ids
Array of numbers

Responses

Request samples

Content type
application/json
{
  • "added_member_ids": [
    ],
  • "removed_member_ids": [
    ]
}

Response samples

Content type
application/json
{
  • "message": "Ok"
}

Lấy danh sách thành viên của quản lý

Lấy danh sách thành viên của một quản lý cụ thể.

path Parameters
manager_id
required
string

ID của quản lý

Responses

Response samples

Content type
application/json
{
  • "id": 0,
  • "avatar": "string",
  • "display_name": "string",
  • "info": {
    },
  • "members_count": 0,
  • "members": [
    ],
  • "is_director": true
}

Lấy danh sách thành viên của giám đốc

Lấy danh sách thành viên của giám đốc.

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

Lấy thông tin quản lý của thành viên

Lấy thông tin quản lý của một thành viên cụ thể.

path Parameters
user_id
required
string

ID của thành viên

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

Chat Bot

Các API dùng để tạo và quản lý chat bot

Lấy danh sách chat bot

Yêu cầu permission: read:list_chat_bot

Trường hợp sử dụng:

  • Workspace Admin lấy danh sách các chat bot đã tạo trên Workspace của mình
Authorizations:
adminKey
query Parameters
last_id
number
Default: 0
Example: last_id=13623512356361325000

Id chat bot gần nhất

length
number
Default: 2
Example: length=10

Số lượng bot muốn lấy tính từ bot_id=last_id

header Parameters
x-gapo-openapi-key
required
string
Example: workspace - xxxxxxxx

Workspace Admin API key

Responses

Response samples

Content type
application/json
{
  • "message": "Succeeded!",
  • "data": [
    ]
}

Tạo chat bot

Yêu cầu permission: create:chat_bot

Trường hợp sử dụng:

  • Workspace Admin tạo chat bot mới
Authorizations:
adminKey
header Parameters
content-type
string
Example: application/json
x-gapo-openapi-key
required
string
Example: workspace - xxxxxxxx

Workspace Admin API key

Request Body schema: application/json
name
required
string

Tên bot

avatar
required
string

Ảnh đại diện bot

Responses

Request samples

Content type
application/json
{}

Response samples

Content type
application/json
{
  • "message": "Succeeded!",
  • "data": {
    }
}

Xoá chat bot

Yêu cầu permission: dalete:chat_bot

Trường hợp sử dụng:

  • Workspace Admin xóa Bot khỏi hệ thống

Note:

  • Thao tác này không thể hoàn tác nên cần chú ý khi thực hiện
Authorizations:
adminKey
query Parameters
bot_id
required
string
Example: bot_id=5820985907745992000

Id của chat bot cần xóa

header Parameters
x-gapo-openapi-key
required
string
Example:

Workspace Admin API key

Responses

Response samples

Content type
application/json
{
  • "message": "Succeeded!"
}

Cập nhật chat bot

Yêu cầu permission: update:chat_bot

Trường hợp sử dụng:

  • Workspace Admin thay tên và ảnh đại diện của chat bot
Authorizations:
adminKey
query Parameters
bot_id
required
string
Example: bot_id=5820985907745992000

Id của chat bot cần cập nhật

header Parameters
x-gapo-openapi-key
required
string
Example: workspace - xxxxxxxx

Workspace Admin API key

Request Body schema: application/json
name
required
string

Tên bot

avatar
required
string

Ảnh đại diện bot

Responses

Request samples

Content type
application/json
{}

Response samples

Content type
application/json
{
  • "message": "Succeeded!",
  • "data": {
    }
}

Lấy thông tin của chat bot

Yêu cầu permission: read:bot_info

Trường hợp sử dụng:

  • Workspace Admin xem lại thông tin chat bot đã tạo
Authorizations:
adminKey
path Parameters
bot_id
required
string
Example: 16131251234146124000

Id chat bot muốn xem thông tin

header Parameters
x-gapo-openapi-key
required
string
Example: workspace - xxxxxxxx

Workspace Admin API key

Responses

Response samples

Content type
application/json
{
  • "message": "Succeeded!",
  • "data": {
    }
}

Lấy danh sách command

Yêu cầu permission: read:list_bot_command

Trường hộp sử dụng:

  • Workspace Admin xem lại danh sách các lệnh đã thêm của chat bot

Note:

  • Có thể dùng bot token để xác thực yêu cầu cho api thay vì dùng adminToken
  • Phải cung cấp ít nhất một trong hai phương thức xác thực: adminKey hoặc botToken
Authorizations:
adminKeybotToken
query Parameters
bot_id
required
string
Example: bot_id=2.154613512351346e+21

Id chat bot muốn kiểm tra

header Parameters
x-gapo-bot-token
string
Example: 52135a32f12c42e6423b12cfd352

Token nhận được khi tạo chat bot hoặc có trong thông tin chi tiết của chat bot

x-gapo-openapi-key
required
string
Example: workspace - xxxxxxxx

Workspace Admin API key

Responses

Response samples

Content type
application/json
{
  • "message": "Succeeded!",
  • "data": [
    ]
}

Thêm command

Yêu cầu permission: create:bot_command

Trường hợp sử dụng:

  • Workspace Admin cấu hình thêm câu lệnh cho chat bot

Note:

  • Có thể dùng bot token để xác thực yêu cầu cho api thay vì adminKey
  • Phải cung cấp ít nhất một trong hai phương thức xác thực: adminKey hoặc botToken
Authorizations:
adminKeybotToken
query Parameters
bot_id
required
string
Example: bot_id=2.154613512351346e+21

Id của chat bot muốn thêm command

header Parameters
x-gapo-bot-token
string
Example: 52135a32f12c42e6423b12cfd352

Token nhận được khi tạo chat bot hoặc có trong thông tin chi tiết của chat bot

x-gapo-openapi-key
string
Example: workspace - xxxxxxxx

Workspace Admin API key

Request Body schema: application/json
description
string

Mô tả về câu lệnh của chat bot

command
required
string

Cú pháp câu lệnh của chat bot

response
required
string

Câu trả lời của chat bot khi nhận được command

Responses

Request samples

Content type
application/json
{
  • "description": "Mô tả câu lệnh",
  • "command": "example_command",
  • "response": "example_response"
}

Response samples

Content type
application/json
{
  • "message": "Succeeded!",
  • "data": {
    }
}

Cập nhật command

Yêu cầu permission: update:bot_command

Trường hợp sử dụng:

  • Workspace Admin cập nhật mô tả và câu trả lời cho cho command

Note:

  • Có thể dùng bot token để xác thực cho api thay vì adminKey
  • Phải cung cấp ít nhất một trong số các phương thức xác thực: adminKey hoặc botToken
Authorizations:
adminKeybotToken
query Parameters
bot_id
required
string
Example: bot_id=2.154613512351346e+21

Id của chat bot cần cập nhật

cmd
required
string
Example: cmd=ping

Command cần cập nhật

header Parameters
x-gapo-bot-token
string
Example: 52135a32f12c42e6423b12cfd352

Token nhận được lúc tạo chat bot hoặc có trong thông tin chi tiết của chat bot

x-gapo-openapi-key
string
Example: workspace - xxxxxxxx

Workspace Admin API key

Request Body schema: application/json
description
string

Mô tả về câu lệnh

response
required
string

Response tương ứng cho command

Responses

Request samples

Content type
application/json
{
  • "description": "",
  • "response": "example_response"
}

Response samples

Content type
application/json
{
  • "message": "Succeeded!",
  • "data": {
    }
}

Xóa command

Yêu cầu permission: delete:bot_command

Trường hợp sử dụng:

  • Workspace Admin xóa bỏ một command đã thiết lập trước đó cho chat bot

Note:

  • Có thể dùng bot token để xác thực cho api thay vì adminKey
  • Phải cung cấp ít nhất một trong hai phương thức xác thực: adminKey hoặc botToken
  • Thao tác này không thể hoàn tác nên phải chú ý khi thực hiện
Authorizations:
adminKeybotToken
query Parameters
bot_id
required
string
Example: bot_id=2.154613512351346e+21

Id chat bot muốn xóa bớt command

cmd
required
string
Example: cmd=ping

Command cần xóa

header Parameters
x-gapo-bot-token
string
Example: 52135a32f12c42e6423b12cfd352

Token nhận được lúc tạo chat bot hoặc có trong thông tin chi tiết của chat bot

x-gapo-openapi-key
string
Example: workspace - xxxxxxxx

Workspace Admin API key

Responses

Response samples

Content type
application/json
{
  • "message": "Succeeded!"
}

Lấy danh sách bot

Authorizations:
bearer
query Parameters
last_id
integer (Last Id)
Default: 0

Id bot gần nhất

length
number (Length) ( 1 .. 11 ]
Default: 2

Số lượng bot muốn lấy tính từ bot(bot_id = last_id)

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "links": {
    }
}

Tạo mới bot

Người dùng tạo mới bot

Authorizations:
bearer
Request Body schema: application/json
required
name
required
string (Name)

Tên bot

avatar
required
string (Avatar)

Ảnh đại diện bot

Responses

Request samples

Content type
application/json
{}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Lấy dữ liệu bot theo id

Authorizations:
bearer
path Parameters
bot_id
required
integer (Bot Id)
Example: 5820985907745992000

Id bot

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

Xoá bot

Authorizations:
bearer
path Parameters
bot_id
required
integer (Bot Id)
Example: 5820985907745992000

Id bot

Responses

Response samples

Content type
application/json
{
  • "code": 1,
  • "message": "Thành công"
}

Cập nhật tên và ảnh đại diện của bot

Authorizations:
bearer
path Parameters
bot_id
required
integer (Bot Id)
Example: 5820985907745992000
Request Body schema: application/json
required
name
required
string (Name)

Tên bot

avatar
required
string (Avatar)

Ảnh đại diện bot

Responses

Request samples

Content type
application/json
{}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Làm mới token cho bot

Authorizations:
bearer
path Parameters
bot_id
required
integer (Bot Id)
Example: 5820985907745992000

Id bot

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

Lưu tin nhắn

Authorizations:
bearer
Request Body schema: application/json
source_thread_id
integer

Mã cuộc trò chuyện gốc

source_message_ids
Array of arrays

Danh sách mã tin nhắn muốn lưu

Responses

Request samples

Content type
application/json
{
  • "source_thread_id": 1231231,
  • "source_message_ids": [
    ]
}

Response samples

Content type
application/json
{
  • "thread_id": 1231233
}

Kiểm tra xem sắp đạt giới hạn tạo bot chưa

Authorizations:
bearer

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

Tạo messsage

header Parameters
Authorization
required
string (Authorization)
Example: Bot 58210300580380:5430f06ae1e14fd1b75e820bd14302c2
Request Body schema: application/json
required
partner_id
string (Partner Id)

Gửi message đến user (user_id = partner_id) với cuộc trò chuyện 1-1

collab_id
string

ID cuả collab mà bot muốn gửi đến

thread_id
integer (Thread Id)

Gửi message đến thread (id = thread_id)

object (BotMessage)

Responses

Request samples

Content type
application/json
{
  • "partner_id": 123123,
  • "collab_id": 6982807365109850000,
  • "thread_id": 123122,
  • "message": {
    }
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Lấy danh sách command đang có của một bot

Authorizations:
bearer
path Parameters
bot_id
required
integer
Example: 5820985907745992000

id của bot

Responses

Response samples

Content type
application/json
{
  • "data": [
    ]
}

Tạo thêm command mới cho bot

Authorizations:
bearer
path Parameters
bot_id
required
integer (Bot Id)
Example: 5820985907745992000

Id bot

Request Body schema: application/json
required
description
string (description)

Mô tả cho bot command

response
string (response)

Nội dung sẽ trả về tương ứng với câu lệnh

command
string (command)

Câu lệnh

object (Attach)

Responses

Request samples

Content type
application/json
{
  • "description": "Ping command",
  • "response": "pong",
  • "command": "ping",
  • "attach": {
    }
}

Response samples

Content type
application/json
{
  • "description": "Mô tả câu lệnh",
  • "command": "example_command",
  • "response": "example_response"
}

Xóa một câu lệnh của bot

Authorizations:
bearer
path Parameters
bot_id
required
integer (Bot Id)
Example: 5820985907745992000

Id bot

cmd
required
string (Command)
Example: ping

command

Responses

Response samples

Content type
application/json
{
  • "code": 1,
  • "message": "Thành công"
}

Cập nhật một câu lệnh của bot

Authorizations:
bearer
path Parameters
bot_id
required
integer (Bot Id)
Example: 5820985907745992000

Id bot

cmd
required
string (Command)
Example: ping

command

Request Body schema: application/json
required
description
string (description)

Mô tả cho bot command

response
string (response)

Nội dung sẽ trả về tương ứng với câu lệnh

object (Attach)

Responses

Request samples

Content type
application/json
{
  • "description": "Ping command",
  • "response": "pong",
  • "attach": {
    }
}

Response samples

Content type
application/json
{
  • "description": "Mô tả câu lệnh",
  • "command": "example_command",
  • "response": "example_response"
}

Tạo tin nhắn cho bên thứ 3

Authorizations:
botToken
Request Body schema: application/json
collab_id
string

ID cuả collab mà bot đang ở trong đó

thread_id
integer

ID của thread mà bot đang ở trong đó

message_id
integer

ID message muốn tạo sub thread

bot_id
required
integer

ID của bot

required
object

Body của tin nhắn, xem chi tiết tại Chat service

receiver_id
integer

ID của user mà bot muốn gửi tin nhắn đến

Responses

Request samples

Content type
application/json
{
  • "collab_id": 6982807365109850000,
  • "thread_id": 0,
  • "message_id": 0,
  • "bot_id": 5821033660159239000,
  • "body": {
    },
  • "receiver_id": 0
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Lấy dữ liệu bot theo id

Authorizations:
bearer
path Parameters
bot_id
required
integer (Bot Id)
Example: 5820985907745992000

Id bot

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

Cập nhật tên và ảnh đại diện của bot

Authorizations:
botToken
path Parameters
bot_id
required
integer (Bot Id)
Example: 5820985907745992000
Request Body schema: application/json
required
name
required
string (Name)

Tên bot

avatar
required
string (Avatar)

Ảnh đại diện bot

Responses

Request samples

Content type
application/json
{}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Lấy danh sách command đang có của một bot

Authorizations:
botToken
path Parameters
bot_id
required
integer
Example: 5820985907745992000

id của bot

Responses

Response samples

Content type
application/json
{
  • "data": [
    ]
}

Tạo thêm command mới cho bot

Authorizations:
botToken
path Parameters
bot_id
required
integer (Bot Id)
Example: 5820985907745992000

Id bot

Request Body schema: application/json
required
description
string (description)

Mô tả cho bot command

response
string (response)

Nội dung sẽ trả về tương ứng với câu lệnh

command
string (command)

Câu lệnh

object (Attach)

Responses

Request samples

Content type
application/json
{
  • "description": "Ping command",
  • "response": "pong",
  • "command": "ping",
  • "attach": {
    }
}

Response samples

Content type
application/json
{
  • "description": "Mô tả câu lệnh",
  • "command": "example_command",
  • "response": "example_response"
}

Xóa một câu lệnh của bot

Authorizations:
botToken
path Parameters
bot_id
required
integer (Bot Id)
Example: 5820985907745992000

Id bot

cmd
required
string (Command)
Example: ping

command

Responses

Response samples

Content type
application/json
{
  • "code": 1,
  • "message": "Thành công"
}

Cập nhật một câu lệnh của bot

Authorizations:
bearer
path Parameters
bot_id
required
integer (Bot Id)
Example: 5820985907745992000

Id bot

cmd
required
string (Command)
Example: ping

command

Request Body schema: application/json
required
description
string (description)

Mô tả cho bot command

response
string (response)

Nội dung sẽ trả về tương ứng với câu lệnh

object (Attach)

Responses

Request samples

Content type
application/json
{
  • "description": "Ping command",
  • "response": "pong",
  • "attach": {
    }
}

Response samples

Content type
application/json
{
  • "description": "Mô tả câu lệnh",
  • "command": "example_command",
  • "response": "example_response"
}

Quản lý bài viết

Các API dùng để quản lý bài viết trong workspace

Lấy danh sách bài viết (Admin)

Yêu cầu permission: read:list_post hoặc sudo:workspace

Trường hợp sử dụng:

  • Admin lấy danh sách bài viết trong workspace
  • Hỗ trợ phân trang với các tham số starting_after và ending_before
Authorizations:
adminKey
query Parameters
limit
number <= 50
Default: 10

Số lượng bài viết tối đa trong một lần gọi API. Giá trị mặc định là 10, tối đa là 50.

starting_after
string

Cursor để lấy trang tiếp theo, lấy từ trường next trong response trước đó

ending_before
string

Cursor để lấy trang trước đó, lấy từ trường prev trong response trước đó

header Parameters
x-gapo-openapi-key
required
string
Example: workspace - xxxxxxxx

Workspace Admin API Key

Responses

Response samples

Content type
application/json
{
  • "message": "Succeeded!",
  • "data": [
    ],
  • "links": {
    }
}

Tạo bài viết (Admin)

Yêu cầu permission: create:post hoặc sudo:workspace

Trường hợp sử dụng:

  • Admin tạo bài viết thay cho một người dùng trong workspace
  • Tự động đăng bài cho người dùng
Authorizations:
adminKey
query Parameters
user_id
required
string
Example: user_id=395658491

ID của người dùng muốn tạo bài viết

header Parameters
x-gapo-openapi-key
required
string
Example: workspace - xxxxxxxx

Workspace Admin API Key

content-type
string
Example: application/json
Request Body schema: application/json
content
required
string

Nội dung bài viết

target
required
string

Nơi đăng bài viết:

  • user:user_id Tạo bài viết trên dòng thời gian của người dùng
  • group:group_id Tạo bài viết trong nhóm
Array of objects (PostMedia)

File media đính kèm trong bài viết

mention
Array of numbers

User id của những người muốn gắn tag trong bài viết

privacy
required
number
Enum: 2 3 4 5

Quyền riêng tư của bài viết

  • 2:Bạn bè - 3:Chỉ mình tôi - 4:Nhóm - 5:Công ty (Workspace)
content_rtf
integer
Default: 0
Enum: 0 1

Đánh dấu nội dung bài viết theo định dạng markdown

  • 0:Văn bản bình thường - 1:Văn bản với định dạng markdown

Responses

Request samples

Content type
application/json
{}

Response samples

Content type
application/json
{
  • "message": "Succeeded!",
  • "data": {
    }
}

Quản lý bình luận

Các API dùng để quản lý bình luận trong workspace

Tạo bình luận (Admin)

Yêu cầu permission: create:comment hoặc sudo:workspace

Trường hợp sử dụng:

  • Admin tạo bình luận thay cho một người dùng trong workspace
  • Tự động tạo bình luận cho người dùng
Authorizations:
adminKey
query Parameters
user_id
required
string
Example: user_id=395658491

ID của người dùng muốn tạo bình luận

header Parameters
x-gapo-openapi-key
required
string
Example: workspace - xxxxxxxx

Workspace Admin API Key

content-type
string
Example: application/json
Request Body schema: application/json
required
id
string
target_id
required
string

Id của đối tượng được bình luận

target_type
required
string
Enum: "post" "media"

Loại đối được được bình luận

parent_id
string

Id Parent của bình luận (bình luận A trả lời bình luận B thì B là parent của A)

required
object

Thông tin tác giả bình luận

text
string

Nội dung của bình luận

Array of objects

Danh sách người được nhắc đến trong bình luận

Array of objects (CommentMedia)

Danh sách tệp đính kèm

object (CommentSticker)

Sticker trong bình luận

object (CommentLink)

Đường dẫn đính kèm trong bình luận

type
number
Enum: 1 2 3 5

Loại bình luận

  • 1:Text only - 2:Image (with text) - 3:Sticker (with text) - 5:Link (with text)
status
number
Enum: 1 2 3

Trạng thái của bình luận

  • 1:pending - 2:active - 3:deleted

Responses

Request samples

Content type
application/json
{}

Response samples

Content type
application/json
{
  • "target_id": 132453267,
  • "target_type": "post",
  • "parent_id": "",
  • "comment_as": {
    },
  • "text": "Xin chào",
  • "mentions": [ ],
  • "medias": [ ],
  • "link": {},
  • "type": 1,
  • "status": 2,
  • "comments": [ ],
  • "reply_count": 0,
  • "react_count": {
    },
  • "total_react": 0,
  • "user": {
    },
  • "page": {
    }
}

Lấy danh sách bình luận (Admin)

Yêu cầu permission: read:list_comment hoặc sudo:workspace

Trường hợp sử dụng:

  • Admin lấy danh sách bình luận của một đối tượng (bài viết, media) trong workspace
Authorizations:
adminKey
query Parameters
target_id
required
string
Example: target_id=657909946202994688

ID của đối tượng cần lấy danh sách bình luận

target_type
required
string
Enum: "post" "media"
Example: target_type=post

Loại đối tượng cần lấy danh sách bình luận

header Parameters
x-gapo-openapi-key
required
string
Example: workspace - xxxxxxxx

Workspace Admin API Key

Responses

Response samples

Content type
application/json
{
  • "message": "Succeeded!",
  • "data": [
    ]
}

Vùng miền

Các API dùng để quản lý Vùng miền

Tạo vùng miền mới

API này cho phép tạo một hoặc nhiều vùng miền mới trong hệ thống.

Request Body schema: application/json
required
required
Array of objects

Responses

Request samples

Content type
application/json
{
  • "regions": [
    ]
}

Response samples

Content type
application/json
{
  • "message": "Vùng miền đã được tạo thành công",
  • "data": [
    ]
}

Lấy danh sách vùng miền

API này cho phép lấy danh sách tất cả các vùng miền hiện có trong hệ thống.

Responses

Response samples

Content type
application/json
{
  • "message": "Lấy danh sách vùng miền thành công",
  • "data": [
    ]
}

Cập nhật vùng miền

API này cho phép cập nhật thông tin của một vùng miền cụ thể trong hệ thống.

path Parameters
region_id
required
string

ID của vùng miền cần cập nhật

Request Body schema: application/json
required
name
required
string

Tên mới của vùng miền

Responses

Request samples

Content type
application/json
{
  • "name": "string"
}

Response samples

Content type
application/json
{
  • "message": "Vùng miền đã được cập nhật thành công",
  • "data": {
    }
}

Xóa người dùng khỏi vùng miền

API này cho phép xóa một người dùng cụ thể khỏi vùng miền trong hệ thống.

path Parameters
region_id
required
string

ID của vùng miền

query Parameters
user_id
required
string

ID của người dùng cần xóa khỏi vùng miền

Responses

Response samples

Content type
application/json
{
  • "message": "Người dùng đã được xóa khỏi vùng miền thành công"
}

Survey

Các API dùng để quản lý khảo sát

Tạo khảo sát

Yêu cầu permission: create:survey hoặc sudo:workspace

Trường hợp sử dụng:

  • Admin tạo khảo sát mới cho workspace
  • Thiết lập lịch khảo sát định kỳ (hàng tuần, hàng tháng hoặc chỉ một lần)
  • Cấu hình đối tượng khảo sát (người dùng, phòng ban, chức vụ, nhóm)
Authorizations:
adminKey
header Parameters
x-gapo-openapi-key
required
string
Example: workspace-xxxxxxxx

Workspace Admin API Key

Request Body schema: application/json
required
title
required
string

Tiêu đề khảo sát

des
string

Mô tả khảo sát

to
Array of integers

Danh sách ID người dùng cần khảo sát

to_department_ids
Array of strings

Danh sách ID phòng ban cần khảo sát

to_role_ids
Array of strings

Danh sách ID chức vụ cần khảo sát

to_thread_ids
Array of strings

Danh sách ID nhóm chat cần khảo sát

required
Array of objects non-empty

Danh sách câu hỏi khảo sát

start_date
integer

Thời gian bắt đầu khảo sát (timestamp)

status
integer
Enum: 1 -1

Trạng thái khảo sát: 1 - running, -1 - pause

type
required
integer
Enum: 1 2

Loại khảo sát: 1 - Công khai, 2 - Riêng tư

sharing_level
integer
Enum: 1 2

Mức độ chia sẻ: 1 - Công khai trong workspace, 2 - Công khai cross workspace

required
object
incognito_mode
boolean

Chế độ ẩn danh

question_draft_id
string

ID bản nháp câu hỏi

banner
object

Thông tin banner khảo sát

owner_ids
Array of integers <= 1 items

Danh sách ID chủ sở hữu khảo sát

editor_ids
Array of integers

Danh sách ID người có quyền chỉnh sửa khảo sát

Responses

Request samples

Content type
application/json
{
  • "title": "Khảo sát sự hài lòng nhân viên",
  • "des": "Khảo sát để hiểu mức độ hài lòng của nhân viên với môi trường làm việc",
  • "to": [
    ],
  • "to_department_ids": [
    ],
  • "to_role_ids": [
    ],
  • "to_thread_ids": [
    ],
  • "questions": [
    ],
  • "start_date": 1640995200,
  • "status": 1,
  • "type": 2,
  • "sharing_level": 1,
  • "schedule": {
    },
  • "incognito_mode": false,
  • "question_draft_id": "string",
  • "banner": { },
  • "owner_ids": [
    ],
  • "editor_ids": [
    ]
}

Response samples

Content type
application/json
{
  • "message": "Succeeded!",
  • "data": {
    }
}

Lấy thông tin chi tiết khảo sát

Yêu cầu permission: read:survey hoặc sudo:workspace

Trường hợp sử dụng:

  • Admin xem chi tiết thông tin khảo sát
  • Lấy thông tin câu hỏi và đáp án
  • Xem thống kê số lượng người tham gia
Authorizations:
adminKey
path Parameters
id
required
string
Example: survey_123456

ID của khảo sát

query Parameters
event_time
integer
Example: event_time=1640995200

Thời gian sự kiện (timestamp)

question_version
integer
Example: question_version=1

Phiên bản câu hỏi

num_of_attendees
integer
Example: num_of_attendees=100

Số lượng người tham gia

fields
Array of strings
Items Enum: "_id" "title" "des" "des_object" "to" "answer_ids" "workspace_ids" "status" "questions" "start_date" "schedule" "creator_id" "created_at" "updated_at" "event_time" "next_time" "creator" "to_users" "count_to" "count_answers" "count_questions" "type" "incognito_mode" "sharing_level" "owner_ids" "editor_ids" "question_version" "to_user_ids" "answer_ids_after_ques_changed"
Example: fields=_id&fields=title&fields=questions&fields=count_answers

Danh sách các trường cần lấy

header Parameters
x-gapo-openapi-key
required
string
Example: workspace-xxxxxxxx

Workspace Admin API Key

Responses

Response samples

Content type
application/json
{
  • "message": "ok",
  • "data": {
    }
}

Cập nhật khảo sát

Yêu cầu permission: update:survey hoặc sudo:workspace

Trường hợp sử dụng:

  • Admin cập nhật thông tin khảo sát đã tồn tại
  • Cập nhật danh sách đối tượng khảo sát
  • Thay đổi lịch khảo sát và cấu hình
Authorizations:
adminKey
path Parameters
id
required
string
Example: survey_123456

ID của khảo sát cần cập nhật

header Parameters
x-gapo-openapi-key
required
string
Example: workspace-xxxxxxxx

Workspace Admin API Key

Request Body schema: application/json
required
title
string

Tiêu đề khảo sát

des
string

Mô tả khảo sát

to
Array of integers

Danh sách ID người dùng cần khảo sát (thay thế hoàn toàn)

to_add
Array of integers

Danh sách ID người dùng cần thêm vào khảo sát

to_remove
Array of integers

Danh sách ID người dùng cần loại bỏ khỏi khảo sát

to_department_ids
Array of strings

Danh sách ID phòng ban cần khảo sát (thay thế hoàn toàn)

to_department_ids_remove
Array of strings

Danh sách ID phòng ban cần loại bỏ khỏi khảo sát

to_role_ids
Array of strings

Danh sách ID chức vụ cần khảo sát (thay thế hoàn toàn)

to_role_ids_remove
Array of strings

Danh sách ID chức vụ cần loại bỏ khỏi khảo sát

to_thread_ids
Array of strings

Danh sách ID nhóm chat cần khảo sát (thay thế hoàn toàn)

to_thread_ids_remove
Array of strings

Danh sách ID nhóm chat cần loại bỏ khỏi khảo sát

Array of objects non-empty

Danh sách câu hỏi khảo sát

start_date
integer

Thời gian bắt đầu khảo sát (timestamp)

status
integer
Enum: 1 -1

Trạng thái khảo sát: 1 - running, -1 - pause

type
integer
Enum: 1 2

Loại khảo sát: 1 - Công khai, 2 - Riêng tư

sharing_level
integer
Enum: 1 2

Mức độ chia sẻ: 1 - Công khai trong workspace, 2 - Công khai cross workspace

object
incognito_mode
boolean

Chế độ ẩn danh

banner
object

Thông tin banner khảo sát

owner_ids
Array of integers

Danh sách ID chủ sở hữu khảo sát

editor_ids
Array of integers

Danh sách ID người có quyền chỉnh sửa khảo sát

Responses

Request samples

Content type
application/json
{
  • "title": "Khảo sát sự hài lòng nhân viên (Cập nhật)",
  • "des": "string",
  • "to": [
    ],
  • "to_add": [
    ],
  • "to_remove": [
    ],
  • "to_department_ids": [
    ],
  • "to_department_ids_remove": [
    ],
  • "to_role_ids": [
    ],
  • "to_role_ids_remove": [
    ],
  • "to_thread_ids": [
    ],
  • "to_thread_ids_remove": [
    ],
  • "questions": [
    ],
  • "start_date": 0,
  • "status": 1,
  • "type": 1,
  • "sharing_level": 1,
  • "schedule": {
    },
  • "incognito_mode": true,
  • "banner": { },
  • "owner_ids": [
    ],
  • "editor_ids": [
    ]
}

Response samples

Content type
application/json
{
  • "message": "Succeeded!",
  • "data": {
    }
}

Xuất kết quả khảo sát

Yêu cầu permission: export:survey_answer hoặc sudo:workspace

Trường hợp sử dụng:

  • Admin yêu cầu xuất kết quả khảo sát
  • API hiện tại trả về message xác nhận thành công

Lưu ý: API này hiện đang trong quá trình phát triển và chỉ trả về message xác nhận.

Authorizations:
adminKey
query Parameters
question_collection_id
required
string
Example: question_collection_id=survey_123456

ID của khảo sát cần xuất kết quả

event_time
required
integer
Example: event_time=1640995200

Thời gian sự kiện khảo sát (timestamp)

header Parameters
x-gapo-openapi-key
required
string
Example: workspace-xxxxxxxx

Workspace Admin API Key

Responses

Response samples

Content type
application/json
{
  • "message": "ok"
}

Tạo mẫu khảo sát

Yêu cầu permission: create:survey_template hoặc sudo:workspace

Trường hợp sử dụng:

  • Admin tạo mẫu khảo sát để tái sử dụng
  • Lưu các câu hỏi thường dùng vào template
  • Tạo template từ khảo sát đã có
Authorizations:
adminKey
header Parameters
x-gapo-openapi-key
required
string
Example: workspace-xxxxxxxx

Workspace Admin API Key

Request Body schema: application/json
required
question_collection_id
string

ID khảo sát gốc (nếu tạo template từ khảo sát có sẵn)

question_draft_id
string

ID bản nháp câu hỏi

title
string

Tiêu đề mẫu khảo sát

des
string

Mô tả mẫu khảo sát

Array of objects non-empty

Danh sách câu hỏi mẫu

is_public
boolean

Mẫu công khai hay riêng tư

creator_id
required
integer

ID người tạo mẫu

Responses

Request samples

Content type
application/json
{
  • "question_collection_id": "survey_123456",
  • "question_draft_id": "draft_123456",
  • "title": "Mẫu khảo sát hài lòng",
  • "des": "Mẫu khảo sát chuẩn cho đánh giá sự hài lòng",
  • "questions": [
    ],
  • "is_public": false,
  • "creator_id": 123
}

Response samples

Content type
application/json
{
  • "message": "ok",
  • "data": {
    }
}

Lấy danh sách mẫu khảo sát

Yêu cầu permission: read:survey_template hoặc sudo:workspace

Trường hợp sử dụng:

  • Admin xem danh sách mẫu khảo sát có sẵn
  • Lọc theo workspace hoặc public templates
  • Phân trang danh sách mẫu
Authorizations:
adminKey
query Parameters
workspace_id
required
string
Example: workspace_id=workspace_123

ID workspace

source
integer
Enum: 1 2
Example: source=1

Nguồn mẫu: 1 - Workspace, 2 - Public

is_public
boolean

Lọc mẫu công khai

page
integer >= 1
Default: 1
Example: page=1

Số trang

limit
integer <= 100
Default: 10
Example: limit=10

Số lượng mẫu trên mỗi trang

header Parameters
x-gapo-openapi-key
required
string
Example: workspace-xxxxxxxx

Workspace Admin API Key

Responses

Response samples

Content type
application/json
{
  • "message": "ok",
  • "data": {
    }
}

Lấy thông tin chi tiết mẫu khảo sát

Yêu cầu permission: read:survey_template hoặc sudo:workspace

Trường hợp sử dụng:

  • Admin xem chi tiết mẫu khảo sát
  • Lấy danh sách câu hỏi trong mẫu
  • Sao chép mẫu để tạo khảo sát mới
Authorizations:
adminKey
path Parameters
id
required
string
Example: template_123456

ID của mẫu khảo sát

header Parameters
x-gapo-openapi-key
required
string
Example: workspace-xxxxxxxx

Workspace Admin API Key

Responses

Response samples

Content type
application/json
{
  • "message": "ok",
  • "data": {
    }
}

Cập nhật mẫu khảo sát

Yêu cầu permission: update:survey_template hoặc sudo:workspace

Trường hợp sử dụng:

  • Admin cập nhật thông tin mẫu khảo sát
  • Chỉnh sửa câu hỏi trong mẫu
  • Thay đổi trạng thái công khai/riêng tư
Authorizations:
adminKey
path Parameters
id
required
string
Example: template_123456

ID của mẫu khảo sát

header Parameters
x-gapo-openapi-key
required
string
Example: workspace-xxxxxxxx

Workspace Admin API Key

Request Body schema: application/json
required
title
string

Tiêu đề mẫu khảo sát

des
string

Mô tả mẫu khảo sát

Array of objects non-empty

Danh sách câu hỏi mẫu

incognito_mode
boolean

Chế độ ẩn danh

creator_id
required
integer

ID người cập nhật

Responses

Request samples

Content type
application/json
{
  • "title": "Mẫu khảo sát hài lòng cập nhật",
  • "des": "Mẫu khảo sát được cập nhật",
  • "questions": [
    ],
  • "incognito_mode": false,
  • "creator_id": 123
}

Response samples

Content type
application/json
{
  • "message": "ok",
  • "data": {
    }
}

Gửi nhắc nhở khảo sát chưa trả lời

Yêu cầu permission: remind:survey hoặc sudo:workspace

Trường hợp sử dụng:

  • Admin gửi nhắc nhở đến những người chưa trả lời khảo sát
  • Tăng tỷ lệ tham gia khảo sát
  • Theo dõi tiến độ khảo sát
Authorizations:
adminKey
path Parameters
id
required
string
Example: survey_123456

ID của khảo sát

header Parameters
x-gapo-openapi-key
required
string
Example: workspace-xxxxxxxx

Workspace Admin API Key

Responses

Response samples

Content type
application/json
{
  • "message": "ok",
  • "data": {
    }
}

Ticket

Các API dùng để trích xuất dữ liệu ticket (Đang cập nhật)

Lấy danh sách ticket đã xử lý (Admin)

Yêu cầu permission: read:ticket hoặc sudo:workspace

Authorizations:
adminKey
query Parameters
limit
integer

Số lượng ticket tối đa trong một lần gọi API. Giá trị mặc định là 10, tối đa là 100.

prev
string

Token phân trang để truy xuất trang trước đó. Token này có thể lấy từ trường link.prev trong phản hồi của API

next
string

Token phân trang để truy xuất trang tiếp theo. Token này có thể lấy từ trường link.next trong phản hồi của API.

from_date
integer
Example: from_date=1743663232000

Thời gian bắt đầu. unix timestamp in milliseconds

to_date
integer

Thời gian kết thúc. unix timestamp in milliseconds

ticket_statuses
integer
Enum: {"2":"Đang xử lý"} {"3":"On-Hold"} {"4":"Đã hủy"} {"5":"Đã xử lý"} {"6":"Đã đóng"} {"7":"Đã xoá"} {"8":"Spam"}

Trạng thái của ticket

header Parameters
x-gapo-openapi-key
required
string
Example: workspace - xxxxxxxx

Workspace Admin API Key

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "link": {
    }
}

Download ticket đã xử lý xong (Admin)

Yêu cầu permission: read:ticket hoặc sudo:workspace

Giới hạn: 1 request mỗi 10 giây, tối đa 10 requests/phút

Trường hợp sử dụng:

  • Admin download ticket về máy local
Authorizations:
adminKey
path Parameters
ticket_id
required
string
Example: 1234567890

Id của ticket cần download

header Parameters
x-gapo-openapi-key
required
string
Example: workspace - xxxxxxxx

Workspace Admin API Key

Responses

Response samples

Content type
application/json
{
  • "message": "Limit phải là kiểu số"
}

Get ticket detail (Admin)

Yêu cầu permission: read:ticket hoặc sudo:workspace

Authorizations:
adminKey
path Parameters
ticket_id
required
string
Example: 1234567890

Id của ticket cần download

header Parameters
x-gapo-openapi-key
required
string
Example: workspace - xxxxxxxx

Workspace Admin API Key

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

Chấm công

Các API dùng để quản lý chấm công trong workspace

API khác

Các API dùng để trích xuất dữ liệu chung của Workspace (Đang cập nhật)

Lấy danh sách các bài viết trong group

Yêu cầu permission: read:list_group_post

Trường hợp sử dụng:

  • Workspace Admin thống kê các bài viết trong group
Authorizations:
adminKey
query Parameters
group_id
required
string
Example: group_id=138316463156868465

Id group mục tiêu

header Parameters
x-gapo-openapi-key
required
string
Example: workspace - xxxxxxxx

Workspace Admin API key

Responses

Response samples

Content type
application/json
{
  • "message": "Succeeded!",
  • "data": [
    ]
}

Lấy danh sách bài vit có chứa hashtag

Yêu cầu perrmission: read:list_post

Trường hợp sử dụng:

  • Lấy danh dách bài viết chứa hashtag cụ thể để thống kê, tính toán kết quả một cuộc thi với hình thức đăng bài viết và t��nh điểm trên lượt tương tác
Authorizations:
adminKey
query Parameters
hashtag
required
string
Example: hashtag=News

Hashtag cần tìm

header Parameters
x-gapo-openapi-key
required
string
Example: workspace - xxxxxxxx

Admin Workpsace api key

Responses

Response samples

Content type
application/json
{
  • "message": "Succeeded!",
  • "data": [
    ]
}

Lấy User ID

Yêu cầu permission: query:user_info

Trường hợp sử dụng:

  • Workspace Admin dùng thông tin đăng nhập để lấy id tài khoản
Authorizations:
adminKey
query Parameters
email
string

Email đăng nhập của người dùng

phone_number
string
Example: phone_number=843762123456

Số điện thoại đăng nhập của người dùng

identifier_code
string
Example: identifier_code=3452345a12b2

Mã định danh đăng nhập của người dùng

header Parameters
x-gapo-openapi-key
required
string
Example: workspace - xxxxxxxx

Workspace Admin API key

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

Xóa vùng miền

API này cho phép xóa một vùng miền cụ thể khỏi hệ thống.

path Parameters
region_id
required
string

ID của vùng miền cần xóa

Responses

Response samples

Content type
application/json
{
  • "message": "Vùng miền đã được xóa thành công"
}

Thêm hoặc xóa user trong nhóm chat

Yêu cầu permission: sudo:workspace

Trường hợp sử dụng:

  • Admin của Workspace thêm các user vào 1 nhóm chat
  • Admin của Workspace xóa các user khỏi 1 nhóm chat

Cách xác định id của nhóm chat:

  1. Truy cập nhóm chat bằng trình duyệt web: Mở trình duyệt web trên máy tính của bạn (ví dụ: Chrome, Firefox, Edge, Safari). Đi đến nhóm chat GapoWork mà bạn muốn tìm ID.

  2. Quan sát thanh địa chỉ (URL): Trên thanh địa chỉ ở phía trên cùng của trình duyệt. Bạn sẽ thấy một đường link (URL) có dạng tương tự như sau:

    https://www.gapowork.vn/collab/7002630072340533288/chat

    Trong đường link trên, ID của nhóm chat chính là (dãy số nằm ở giữa collab//chat): 7002630072340533288

Authorizations:
adminKey
header Parameters
content-type
string
Example: application/json
x-gapo-openapi-key
required
string
Example: workspace - xxxxxxxx

Workspace Admin API key

Request Body schema: application/json
emails
Array of strings

Danh sách email trên GapoWork muốn thêm vào nhóm chat

id
string

id của nhóm chat

user_ids
Array of integers

Danh sách user_id trên GapoWork muốn thêm vào nhóm chat

action_type
string
Enum: "add" "remove"

Hành động muốn thực hiện:

  • add - Thêm user vào nhóm chat
  • remove - Xóa user khỏi nhóm chat

Responses

Request samples

Content type
application/json
{
  • "emails": [
    ],
  • "id": "0",
  • "user_ids": [
    ],
  • "action_type": "add"
}

Response samples

Content type
application/json
{
  • "message": "Succeeded!"
}

Thêm hoặc xóa user trong group

Yêu cầu permission: sudo:workspace

Trường hợp sử dụng:

  • Admin của Workspace thêm các user vào 1 group
  • Admin của Workspace xóa các user khỏi 1 group

Cách xác định id của group:

  1. Truy cập Group bằng trình duyệt web: Mở trình duyệt web trên máy tính của bạn (ví dụ: Chrome, Firefox, Edge, Safari). Đi đến group GapoWork mà bạn muốn tìm ID.

  2. Quan sát thanh địa chỉ (URL): Trên thanh địa chỉ ở phía trên cùng của trình duyệt. Bạn sẽ thấy một đường link (URL) có dạng tương tự như sau:

    https://www.gapowork.vn/group/2386499952504047616

    Trong đường link trên, ID của group chính là (dãy số nằm ở cuối cùng): 2386499952504047616

Authorizations:
adminKey
header Parameters
content-type
string
Example: application/json
x-gapo-openapi-key
required
string
Example: workspace - xxxxxxxx

Workspace Admin API key

Request Body schema: application/json
emails
Array of strings

Danh sách email trên GapoWork muốn thêm vào group

id
string

id gủa group

user_ids
Array of integers

Danh sách user_id trên GapoWork muốn thêm vào group

action_type
string
Enum: "add" "remove"

Hành động muốn thực hiện:

  • add - Thêm user vào group
  • remove - Xóa user khỏi group

Responses

Request samples

Content type
application/json
{
  • "emails": [
    ],
  • "id": "0",
  • "user_ids": [
    ],
  • "action_type": "add"
}

Response samples

Content type
application/json
{
  • "message": "Succeeded!"
}

Liên hệ

Hãy liên hệ đến đội hỗ trợ của GapoWork để chúng tôi có thể giúp đỡ các vấn đề liên quan đến OpenAPI qua các kênh liên lạc sau:

Hotline: 1900 633 388

Email: hotro@gapo.com.vn

Văn phòng Hà Nội: Tầng M, toà B Golden Land, 275 Nguyễn Trãi, Thanh Xuân, Hà Nội.

Văn phòng Hồ Chí Minh: Tầng M, toà nhà IPC, 1489 Nguyễn Văn Linh, Tân Phong, Quận 7, Thành phố Hồ Chí Minh