Không gian

Ghi chú
Cấp độ chuyên gia
Khóa API nên được gửi dưới dạng mã thông báo Bearer trong tiêu đề Ủy quyền của yêu cầu. Lấy khóa API của bạn.
Danh sách

Điểm cuối API:

GET
https://www.url.spa/api/v1/spaces

Ví dụ yêu cầu:

curl --location --request GET 'https://www.url.spa/api/v1/spaces' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {api_key}'
Tham số
Loại
Mô tả
search
tùy chọn string
Truy vấn tìm kiếm.
search_by
tùy chọn string
Tìm kiếm theo. Các giá trị có thể là: name cho Tên. Mặc định là: name.
sort_by
tùy chọn string
Sắp xếp theo. Các giá trị có thể là: id cho Ngày tạo, name cho Tên. Mặc định là: id.
sort
tùy chọn string
Sắp xếp. Các giá trị có thể là: desc cho Giảm dần, asc cho Tăng dần. Mặc định là: desc.
per_page
tùy chọn integer
Kết quả mỗi trang. Các giá trị có thể là: 10, 25, 50, 100. Mặc định là: 100.
Hiển thị

Điểm cuối API:

GET
https://www.url.spa/api/v1/spaces/{id}

Ví dụ yêu cầu:

curl --location --request GET 'https://www.url.spa/api/v1/spaces/{id}' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {api_key}'
Lưu trữ

Điểm cuối API:

POST
https://www.url.spa/api/v1/spaces

Ví dụ yêu cầu:

curl --location --request POST 'https://www.url.spa/api/v1/spaces' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Authorization: Bearer {api_key}' \
--data-urlencode 'name={name}'
Tham số
Loại
Mô tả
name
bắt buộc string
Tên không gian.
color
tùy chọn integer
Mã màu. Các giá trị có thể là: 1, 2, 3, 4, 5, 6. Mặc định là: 1.
Cập nhật

Điểm cuối API:

PUT PATCH
https://www.url.spa/api/v1/spaces/{id}

Ví dụ yêu cầu:

curl --location --request PUT 'https://www.url.spa/api/v1/spaces/{id}' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Authorization: Bearer {api_key}'
Tham số
Loại
Mô tả
name
tùy chọn string
Tên không gian.
color
tùy chọn integer
Mã màu. Các giá trị có thể là: 1, 2, 3, 4, 5, 6.
Xóa

Điểm cuối API:

DELETE
https://www.url.spa/api/v1/spaces/{id}

Ví dụ yêu cầu:

curl --location --request DELETE 'https://www.url.spa/api/v1/spaces/{id}' \
--header 'Authorization: Bearer {api_key}'