service/get.stages
POST/extapi/v1/service/get.stagesGọi qua 360: POST https://partner.quantri360.com/v1/base_service/extapi/v1/service/get.stages
Sắp mở. API này đã chạy thật qua 360 và đang được chốt giá — bạn có thể đọc tài liệu và chuẩn bị tích hợp trước.
Mô tả API
Các KHỐI (bước) của một quy trình: tên bước, loại (việc, duyệt, song song, gộp, kết thúc), người phụ trách mặc định, thời lượng định mức, bước kế tiếp. Dùng để dựng sơ đồ quy trình và hiểu block_id trong từng bước của phiếu.
- Thiếu / sai service_id →
code0. - Thứ tự mảng không phải thứ tự chạy — đi theo
properties.next_block_idsbắt đầu từnext_block_idscủa quy trình (service/get.all).
Request
Địa chỉ
POST https://partner.quantri360.com/v1/base_service/extapi/v1/service/get.stages
Xác thực & gian hàng
| Tên | Vị trí | Kiểu | Mẫu | Mô tả |
|---|---|---|---|---|
| Authorization | header | header | Bearer q360_live_ab12cd34_… | Khóa API của brand (tạo ở mục API key). Bắt buộc với mọi request. Brand suy từ key — không truyền mã brand. |
| platform_shop_id | query | string | heradg | Tên kết nối Base Service (GET /v1/platforms). Có thể bỏ khi chỉ nối một token. |
| username | body | string | nguyenvana | API ghi (tạo / sửa / thực thi / chuyển khối / giao người) chạy DƯỚI TÊN người dùng Base này — phải là người có quyền ở khối đó. |
Tham số request
| Tên | Vị trí | Kiểu | Bắt buộc | Mẫu | Mô tả |
|---|---|---|---|---|---|
| service_id | body | string | Có | 73460 | Mã quy trình (service/get.all → services[].id). |
Ví dụ request
curl -s -X POST "https://partner.quantri360.com/v1/base_service/extapi/v1/service/get.stages" \
-H "Authorization: Bearer $KEY" \
-H "Content-Type: application/json" \
-d '{"service_id":"73460"}'
Python
import requests
KEY = "q360_live_..." # khóa API của brand
r = requests.post(
"https://partner.quantri360.com/v1/base_service/extapi/v1/service/get.stages",
params={},
json={
"service_id": "73460"
},
headers={"Authorization": f"Bearer {KEY}"},
timeout=60,
)
print(r.status_code)
print(r.json())Node.js
const KEY = 'q360_live_...'; // khóa API của brand
const url = new URL('https://partner.quantri360.com/v1/base_service/extapi/v1/service/get.stages');
for (const [k, v] of Object.entries({})) url.searchParams.set(k, typeof v === 'object' ? JSON.stringify(v) : String(v));
const r = await fetch(url, {
method: 'POST',
headers: { Authorization: `Bearer ${KEY}`, 'Content-Type': 'application/json' },
body: JSON.stringify({"service_id":"73460"}),
});
console.log(r.status, await r.json());PHP
<?php
$key = 'q360_live_...'; // khóa API của brand
$url = 'https://partner.quantri360.com/v1/base_service/extapi/v1/service/get.stages' . '?' . http_build_query([]);
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: Bearer ' . $key, 'Content-Type: application/json']);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"service_id":"73460"}');
$res = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
echo $status, "\n", $res;Response
Tham số phản hồi (nguyên của Base Service)
| Tên | Kiểu | Mẫu | Mô tả |
|---|---|---|---|
| code | int | 1 | 1 = thành công · 0 = lỗi. |
| message | string | GET_DATA_SUCCESSFULLY | |
| stages | object[] | Mỗi phần tử một khối. | |
| id | string | 73466 | Mã khối = `block_id` của bước phiếu. |
| name | string | Phát lệnh sản xuất | Tên bước. |
| root_id | string | 73460 | Quy trình chứa khối. |
| metatype | string | task | Loại: `custom` (bước mở đầu) · `task` (việc) · `approval` (duyệt) · `approved_endpoint` / `rejected_endpoint` / `asked_more_endpoint` / `bypassed_endpoint` (nhánh kết quả duyệt) · `parallel` (tách song song) · `merge` (gộp) · `end_service` (hoàn thành). |
| assignees | string[] | ["tranthib"] | Người phụ trách mặc định. |
| followers | string[] | [] | Người theo dõi. |
| properties | object | ||
| next_block_ids | string[] | ["73965"] | Khối kế tiếp. |
| duration | string | 48 | Thời lượng định mức (giờ) — hạn của bước = lúc bắt đầu + duration. |
| fixed_followers | string[] | ||
| rules | object | workflow (`one_for_all` · `sequential`), assignment_rule (`fixed_assignee` · `fixed_approvers` · `keep_prev_assignee`), start_sla, service_variables… | |
| form | object[] | [] | Trường thông tin riêng của bước (nếu có). |
| … | Còn: acl, permissions, embed_link, since, last_update… |
Mẫu phản hồi
{
"code": 1,
"message": "GET_DATA_SUCCESSFULLY",
"data": null,
"httpCode": "200",
"stages": [
{
"id": "73461",
"name": "Phát đơn",
"root_id": "73460",
"metatype": "custom",
"assignees": [],
"followers": [
"tranthib"
],
"properties": {
"next_block_ids": [
"73465"
],
"duration": "24"
},
"rules": {
"workflow": "one_for_all",
"assignment_rule": "keep_prev_assignee"
}
},
{
"id": "73467",
"name": "Lên PAKD (bao gồm giá NPL, CM)",
"root_id": "73460",
"metatype": "task",
"assignees": [
"tranthib"
],
"followers": [],
"properties": {
"next_block_ids": [
"73965"
],
"duration": "48"
},
"rules": {
"workflow": "one_for_all",
"assignment_rule": "fixed_assignee"
}
},
{
"id": "73475",
"name": "Duyệt PAKD",
"root_id": "73460",
"metatype": "approval",
"assignees": [
"levanc"
],
"followers": [],
"properties": {
"next_block_ids": [
"73471",
"73472",
"73473"
],
"duration": "12"
},
"rules": {
"workflow": "sequential",
"assignment_rule": "fixed_approvers"
}
}
]
}
Bắt đầu dùng
- Đăng ký tài khoản Partner
- Mở loại dữ liệu thuộc nhóm Quy trình & khối ở trang nền tảng
- Tạo API key (tick kênh Base Service)
- Gọi theo ví dụ ở trên