Chuyển đến nội dung
Nhà phát triển

Tài liệu tham chiếu REST API

Mọi thứ dưới /public/v1, được tạo từ các route mà máy chủ thực sự có. Gửi JSON, nhận JSON.

Địa chỉ gốc

Gửi mọi yêu cầu đến địa chỉ này. PostNimbo tự lưu trữ thì dùng địa chỉ backend của riêng nó.

https://postnimbo.com/api/public/v1

Xác thực

Đặt thông tin xác thực nguyên trạng vào header Authorization, không có tiền tố Bearer. Có hai loại dùng được:

  • Khóa API, lấy trong Cài đặt > Tác nhân / Dev. Khóa hoạt động với tư cách cả không gian làm việc và truy cập được mọi route bên dưới.
  • Access token OAuth (bắt đầu bằng pos_), lấy từ một ứng dụng OAuth. Token hoạt động với tư cách thành viên đã chấp thuận nó, chỉ thấy thương hiệu và kênh của người đó, và bị giới hạn trong các scope họ đã chấp thuận.
curl https://postnimbo.com/api/public/v1/me \
  -H "Authorization: <api key or pos_ token>"

Thiếu hoặc sai thông tin xác thực sẽ trả về 401. Route mà token chưa được chấp thuận sẽ trả về 403. Lỗi có trường msg hoặc message.

Giới hạn tần suất

  • 120 yêu cầu mỗi phút cho mỗi khóa API hoặc token, tính trên mọi route.
  • Việc tạo bài đăng còn bị giới hạn theo không gian làm việc mỗi giờ (mặc định 90).
  • Khi vượt giới hạn, phản hồi là 429 kèm header Retry-After tính bằng giây. Hãy chờ đúng chừng đó rồi mới thử lại.

Máy chủ tự lưu trữ đặt giới hạn riêng bằng PUBLIC_API_RATE_LIMIT, PUBLIC_API_RATE_TTL và API_LIMIT.

Endpoint

Cột scope là quyền mà token OAuth cần. Khóa API truy cập được mọi route.

Account

  • GET/public/v1/me

    The workspace the credential belongs to, and for an OAuth token the member who approved it.

    Phạm viMọi token
  • GET/public/v1/is-connected

    Check that the credential works.

    Phạm viMọi token
  • GET/public/v1/groups

    The brands (customers) the credential can see.

    Phạm viMọi token
  • GET/public/v1/counts

    Posts waiting for approval and unread open inbox conversations.

    Phạm viposts:readinbox:readĐầu vàoquery: brandId?

Channels

  • GET/public/v1/integrations

    The connected channels, with their ids and networks.

    Phạm viposts:readĐầu vàoquery: group? (a brand id)
  • GET/public/v1/integration-settings/:id

    The rules of a channel: character limits, media rules and the settings a post needs.

    Phạm viKhóa API hoặc token toàn quyền
  • GET/public/v1/find-slot/:id

    The next free posting slot of a channel.

    Phạm viposts:read
  • GET/public/v1/social/:integration

    The sign-in link that connects a new channel of a network (for example linkedin).

    Phạm viKhóa API hoặc token toàn quyềnĐầu vàoquery: refresh? (a channel id to reconnect)
  • DELETE/public/v1/integrations/:id

    Disconnect a channel.

    Phạm viKhóa API hoặc token toàn quyền
  • POST/public/v1/integration-trigger/:id

    Run a lookup a network offers (for example the playlists of a YouTube channel).

    Phạm viKhóa API hoặc token toàn quyềnĐầu vàobody: { methodName, data }

Posts

  • GET/public/v1/posts

    The posts between two dates.

    Phạm viposts:readĐầu vàoquery: startDate, endDate (ISO 8601), customer?
  • POST/public/v1/posts

    Create a draft, schedule a post or publish now, on one or more channels.

    Phạm viposts:scheduleĐầu vàobody: { type: draft|schedule|now, date, shortLink, tags, posts: [{ integration: { id }, value: [{ content, image? }], settings? }] }
  • PUT/public/v1/posts/:id/settings

    Change the network settings of a post.

    Phạm viKhóa API hoặc token toàn quyềnĐầu vàobody: { settings }
  • PUT/public/v1/posts/:id/status

    Move a post between draft and scheduled.

    Phạm viKhóa API hoặc token toàn quyềnĐầu vàobody: { status: draft|schedule }
  • GET/public/v1/posts/:id/missing

    For a post the network accepted without returning its id: the recent posts of the channel to pick it from.

    Phạm viKhóa API hoặc token toàn quyền
  • PUT/public/v1/posts/:id/release-id

    Link a post to the network post it became.

    Phạm viKhóa API hoặc token toàn quyềnĐầu vàobody: { releaseId }
  • DELETE/public/v1/posts/:id

    Delete a post.

    Phạm viKhóa API hoặc token toàn quyền
  • DELETE/public/v1/posts/group/:group

    Delete every post of a group (one post sent to several channels).

    Phạm viKhóa API hoặc token toàn quyền

Media

  • POST/public/v1/upload

    Upload a file to the media library.

    Phạm vimedia:writeĐầu vàomultipart: file, adjust?
  • POST/public/v1/upload-from-url

    Add a file from a public https address.

    Phạm vimedia:writeĐầu vàobody: { url, adjust? }
  • GET/public/v1/media

    The media library, a page at a time.

    Phạm viKhóa API hoặc token toàn quyềnĐầu vàoquery: page?, search?, folder?
  • GET/public/v1/media/:id/status

    Whether an uploaded video finished processing.

    Phạm viKhóa API hoặc token toàn quyền

Ideas

  • POST/public/v1/ideas

    Save an idea to the Ideas board.

    Phạm viideas:writeĐầu vàobody: { title, content? }
  • DELETE/public/v1/ideas/:id

    Remove an idea the credential saved.

    Phạm viideas:write

Analytics

  • GET/public/v1/performance

    A summary of the last 7 days: posts, reach and engagement.

    Phạm vianalytics:readĐầu vàoquery: brandId?, tz?
  • GET/public/v1/best-times/next

    The next best times to post, from your own results.

    Phạm viposts:readĐầu vàoquery: integrationId?, brandId?, tz?, goal?: engagement|reach|views, count? (1-20)
  • GET/public/v1/analytics/:integration

    The analytics of a channel.

    Phạm viKhóa API hoặc token toàn quyềnĐầu vàoquery: date (days back)
  • GET/public/v1/analytics/post/:postId

    The analytics of one published post.

    Phạm viKhóa API hoặc token toàn quyềnĐầu vàoquery: date (days back)

AI

  • POST/public/v1/ai/draft

    Draft a post about a web page with PostNimbo AI.

    Phạm viai:useĐầu vàobody: { url, title?, selection?, mode: summary|captions }
  • POST/public/v1/ai/reply

    Draft a reply to a comment or message.

    Phạm viai:useĐầu vàobody: { text, url? }

Link in bio

  • GET/public/v1/link-in-bio

    The link-in-bio pages of the workspace.

    Phạm vilink-in-bio:write
  • POST/public/v1/link-in-bio/:id/links

    Add a link to a link-in-bio page.

    Phạm vilink-in-bio:writeĐầu vàobody: { label, url }

Video and clipping

  • POST/public/v1/generate-video

    Generate a video with one of the AI video tools.

    Phạm viKhóa API hoặc token toàn quyền
  • POST/public/v1/video/function

    Load the options of a video tool (voices, avatars).

    Phạm viKhóa API hoặc token toàn quyền
  • POST/public/v1/clipping

    Cut a long video into short clips.

    Phạm viKhóa API hoặc token toàn quyền
  • GET/public/v1/clipping

    The clipping jobs, a page at a time.

    Phạm viKhóa API hoặc token toàn quyềnĐầu vàoquery: page
  • GET/public/v1/clipping/:id

    One clipping job and its clips.

    Phạm viKhóa API hoặc token toàn quyền

Notifications

  • GET/public/v1/notifications

    The workspace notifications, a page at a time.

    Phạm viKhóa API hoặc token toàn quyềnĐầu vàoquery: page?

Webhooks

  • GET/public/v1/webhooks/events

    The events a webhook is sent, with a sample payload of each.

    Phạm viMọi token
  • GET/public/v1/webhooks

    The webhooks of the workspace, without their addresses; ?url= finds the webhooks of one address.

    Phạm viwebhooks:writeĐầu vàoquery: url?
  • POST/public/v1/webhooks

    Subscribe an address to events (how Zapier, Make and n8n triggers switch on).

    Phạm viwebhooks:writeĐầu vàobody: { url, events?, integrations? (channel ids), name? }
  • DELETE/public/v1/webhooks/:id

    Remove a webhook (how a trigger switches off).

    Phạm viwebhooks:write

Bạn đang xây dựng gì đó với PostNimbo?

Hãy cho chúng tôi biết bạn đang làm gì. Chúng tôi hỗ trợ về API, xét duyệt ứng dụng cho danh bạ và bổ sung các endpoint mà tích hợp cần.