API Gửi yêu cầu duyệt kịch bản

API duyệt kịch bản

Tiền điều kiện:

  1. Đã tạo Ứng dụng trên hệ thống Vbee AICall Cloud (xem cách tạo)

  2. Đã có kịch bản và chưa được duyệt (xem cách tạo)

  3. Đã tạo ACCESS_TOKEN (xem cách tạo)

Chi tiết API

Duyệt kịch bản

POST https://aicall.vbee.ai/api/v1/public-api/scenarios/:scenario_id/submit

(*) Trường bắt buộc

Path Parameters

Name
Type
Description

scenario_id*

String

Mã kịch bản cần duyệt

Headers

Name
Type
Description

Authorization

String

Bearer <ACCESS_TOKEN>

{
  "message": "success",
  "status": 1
}

Nếu bạn có kích hoạt webhook, xem định dạng dữ liệu trả về ở mục Webhook API

Nội dung lỗi trả về có thuộc tính status luôn là 0. Ví dụ:

{
  "status": 0,
  "code": 401,
  "message": "Unauthorized"
}

Danh sách mã lỗi:

Code
Message
Mô tả

401

Unauthorized

ACCESS_TOKEN không hợp lệ

1201

Application is not found

Không tìm thấy ứng dụng

(kiểm tra lại thông tin API_KEY)

3001

Scenario s not found

Không tìm thấy kịch bản

3006

Status of scenario must be DRAFT to submit

Chỉ có thể duyệt kịch bản ở trạng thái nháp

9999

Uknown error

Lỗi phát sinh trên hệ thống

Code mẫu

const axios = require('axios');

const ACCESS_TOKEN = '<ACCESS_TOKEN>';
const SCENARIO_ID = '<SCENARIO_ID>';

axios({
  method: 'POST',
  url: `https://aicall.vbee.ai/api/v1/public-api/scenarios/${SCENARIO_ID}/submit`,
  headers: {
    Authorization: `Bearer ${ACCESS_TOKEN}`,
  },
});

Last updated