API Documentation v1.0

VietSolve APIDocumentation

Tài liệu API đầy đủ để tích hợp nền tảng AI Commerce của VietSolve vào hệ thống của bạn

Giới thiệu

VietSolve API cho phép bạn tích hợp các tính năng AI Commerce mạnh mẽ vào ứng dụng của mình. API được xây dựng theo chuẩn RESTful với JSON response format.

Nhanh chóng

Response time < 200ms

Bảo mật

SSL/TLS encryption

RESTful

Standard HTTP methods

Base URL: https://api.vietsolve.com/v1

Xác thực

VietSolve API sử dụng API keys để xác thực requests. Bạn có thể quản lý API keys trong Partner Portal.

Cách sử dụng API Key:

Authorization Header
Authorization: Bearer your_api_key_here

⚠️ Lưu ý: Không bao giờ chia sẻ API key của bạn hoặc commit vào source control. Sử dụng environment variables để lưu trữ API keys.

Ví dụ Code

// Khởi tạo VietSolve API Client
import { VietSolveAPI } from '@vietsolve/api-client';

const client = new VietSolveAPI({
  apiKey: 'your_api_key_here',
  environment: 'production'
});

// Tạo chiến dịch mới
const campaign = await client.campaigns.create({
  name: 'Summer Sale 2025',
  type: 'social_media',
  budget: 50000000,
  target_audience: {
    age_range: [25, 45],
    interests: ['fashion', 'lifestyle'],
    location: 'Vietnam'
  }
});

console.log('Campaign created:', campaign.id);

API Endpoints

POST/api/v1/campaigns/create

Tạo chiến dịch marketing mới

nametypebudgettarget_audience
GET/api/v1/campaigns/{id}

Lấy thông tin chi tiết chiến dịch

id
PUT/api/v1/campaigns/{id}

Cập nhật chiến dịch

idnamebudgetstatus
GET/api/v1/analytics/performance

Lấy dữ liệu phân tích hiệu suất

campaign_idstart_dateend_date
POST/api/v1/ai/generate-content

Tạo nội dung marketing bằng AI

typeprompttonelength

Mã lỗi

Mô tả
200OK - Yêu cầu thành công
201Created - Tạo tài nguyên thành công
400Bad Request - Yêu cầu không hợp lệ
401Unauthorized - Thiếu hoặc sai API key
403Forbidden - Không có quyền truy cập
404Not Found - Không tìm thấy tài nguyên
429Too Many Requests - Vượt quá giới hạn tốc độ
500Internal Server Error - Lỗi máy chủ

Giới hạn tốc độ

VietSolve API áp dụng rate limiting để đảm bảo chất lượng dịch vụ cho tất cả người dùng.

1,000
requests/hour
Free tier
10,000
requests/hour
Pro tier
Custom
requests/hour
Enterprise tier

Response Headers: Mỗi response sẽ bao gồm các headersX-RateLimit-Limit,X-RateLimit-Remaining, vàX-RateLimit-Reset

SDKs & Libraries

JavaScript/TypeScript

npm install @vietsolve/api-client
Xem documentation →

Python

pip install vietsolve
Xem documentation →

PHP

composer require vietsolve/api-client
Xem documentation →

Ruby

gem install vietsolve
Xem documentation →

Hỗ trợ

Cần hỗ trợ với API? Đội ngũ kỹ thuật của chúng tôi luôn sẵn sàng giúp đỡ bạn.

Sẵn sàng bắt đầu?

Đăng ký tài khoản Partner để nhận API key và bắt đầu tích hợp ngay hôm nay