Liệt kê bài đăng
curl --request GET \
--url https://app.getkavio.app/api/posts \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.getkavio.app/api/posts"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.getkavio.app/api/posts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.getkavio.app/api/posts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.getkavio.app/api/posts"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://app.getkavio.app/api/posts")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.getkavio.app/api/posts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": [
{
"id": "<string>",
"content": "<string>",
"media": [
{}
],
"status": "<string>",
"scheduled_at": "<string>",
"published_at": "<string>",
"platforms": [
{
"id": "<string>",
"platform": "<string>",
"content_type": "<string>",
"status": "<string>",
"enabled": true,
"platform_url": "<string>",
"published_at": "<string>",
"error_message": "<string>",
"display_name": "<string>",
"display_username": "<string>",
"display_avatar": "<string>",
"social_account": {}
}
],
"labels": [
{}
],
"created_at": "<string>",
"updated_at": "<string>"
}
]
}Bài đăng
Liệt kê bài đăng
Liệt kê bài đăng trong không gian làm việc hiện tại, mỗi trang 15 bài.
GET
/
posts
Liệt kê bài đăng
curl --request GET \
--url https://app.getkavio.app/api/posts \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.getkavio.app/api/posts"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.getkavio.app/api/posts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.getkavio.app/api/posts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.getkavio.app/api/posts"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://app.getkavio.app/api/posts")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.getkavio.app/api/posts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": [
{
"id": "<string>",
"content": "<string>",
"media": [
{}
],
"status": "<string>",
"scheduled_at": "<string>",
"published_at": "<string>",
"platforms": [
{
"id": "<string>",
"platform": "<string>",
"content_type": "<string>",
"status": "<string>",
"enabled": true,
"platform_url": "<string>",
"published_at": "<string>",
"error_message": "<string>",
"display_name": "<string>",
"display_username": "<string>",
"display_avatar": "<string>",
"social_account": {}
}
],
"labels": [
{}
],
"created_at": "<string>",
"updated_at": "<string>"
}
]
}Yêu cầu
integer
Số trang cần lấy. Mặc định là
1.Phản hồi
Trả về bài đăng theoscheduled_at giảm dần (mới nhất trước), mỗi trang 15 bài.
array
Hiện thuộc tính con
Hiện thuộc tính con
string
UUID của bài đăng.
string
Nội dung văn bản của bài đăng. Có thể là
null với bản nháp.array
Nội dung đa phương tiện đính kèm bài đăng. Mỗi mục có
id, path, url,
type (image | video), mime_type, original_filename. Là mảng rỗng
nếu không có nội dung nào.string
Một trong các giá trị:
draft, scheduled, publishing, published,
partially_published, failed.string
Thời điểm dự kiến đăng theo định dạng
Y-m-d H:i:s. Có thể là null với
bản nháp chưa lên lịch.string
Thời điểm đăng hoàn tất theo định dạng
Y-m-d H:i:s. Là null cho đến
khi đăng xong.array
Mỗi
post_platform có một mục, tương ứng một tài khoản mạng xã hội của
bài đăng.Hiện thuộc tính con
Hiện thuộc tính con
string
UUID của bản ghi post_platform. Dùng giá trị này trong
PUT /posts/ {post} để bật hoặc tắt nền tảng.string
Mã nền tảng, chẳng hạn
linkedin, linkedin-page, x, facebook,
instagram, instagram-facebook, tiktok, youtube, threads,
pinterest, bluesky, mastodon.string
Định dạng dùng cho nền tảng, chẳng hạn
linkedin_post,
instagram_reel. Xem GET /content-types.string
Trạng thái đăng trên nền tảng:
pending, publishing, published
hoặc failed.boolean
Bài có được đăng lên nền tảng này hay không.
string
URL công khai của bài đã đăng. Là
null cho đến khi đăng thành công.string
Thời điểm đăng trên nền tảng theo định dạng
Y-m-d H:i:s. Là null
cho đến khi đăng xong.string
Nguyên nhân lỗi từ lần đăng thất bại gần nhất. Là
null nếu thành
công.string
Bản chụp tên hiển thị của tài khoản mạng xã hội (vẫn được giữ nếu tài
khoản bị ngắt kết nối sau đó).
string
Bản chụp tên người dùng hoặc handle.
string
URL bản chụp ảnh đại diện.
object
Tài khoản mạng xã hội đã kết nối. Gồm các trường:
id, platform,
display_name, username, is_active, status (connected |
disconnected | token_expired).array
Các nhãn trong không gian làm việc được gắn với bài đăng. Mỗi mục có
id,
name, color, created_at, updated_at.string
Thời điểm tạo theo định dạng
Y-m-d H:i:s.string
Thời điểm cập nhật gần nhất theo định dạng
Y-m-d H:i:s.curl -X GET https://app.getkavio.app/api/posts \
-H "Authorization: Bearer YOUR_API_KEY"
{
"data": [
{
"id": "9f1a2b3c-4d5e-6f7a-8b9c-0d1e2f3a4b5c",
"content": "Excited to announce our new feature!",
"media": [],
"status": "scheduled",
"scheduled_at": "2025-01-15 10:00:00",
"published_at": null,
"platforms": [
{
"id": "a1b2c3d4-e5f6-7a8b-9c0d-1e2f3a4b5c6d",
"platform": "linkedin",
"content_type": "linkedin_post",
"status": "pending",
"enabled": true,
"platform_url": null,
"published_at": null,
"error_message": null,
"display_name": "John Doe",
"display_username": "johndoe",
"display_avatar": "https://media.licdn.com/.../avatar.jpg",
"social_account": {
"id": "b2c3d4e5-f6a7-8b9c-0d1e-2f3a4b5c6d7e",
"platform": "linkedin",
"display_name": "John Doe",
"username": "johndoe",
"is_active": true,
"status": "connected"
}
}
],
"labels": [],
"created_at": "2025-01-14 09:00:00",
"updated_at": "2025-01-14 09:00:00"
}
],
"links": {
"first": "https://app.getkavio.app/api/posts?page=1",
"last": "https://app.getkavio.app/api/posts?page=1",
"prev": null,
"next": null
},
"meta": {
"current_page": 1,
"from": 1,
"to": 1,
"last_page": 1,
"per_page": 15,
"total": 1,
"path": "https://app.getkavio.app/api/posts",
"links": [
{
"url": null,
"label": "« Previous",
"page": null,
"active": false
},
{
"url": "https://app.getkavio.app/api/posts?page=1",
"label": "1",
"page": 1,
"active": true
},
{ "url": null, "label": "Next »", "page": null, "active": false }
]
}
}

