跳到正文
开发者

REST API 参考

/public/v1 下的全部接口,根据服务器实际存在的路由生成。JSON 输入,JSON 输出。

基础地址

所有请求都发送到这个地址。自托管的 PostNimbo 则使用它自己的后端地址。

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

身份验证

把凭据原样放在 Authorization 请求头中,不要加 Bearer 前缀。支持两种凭据:

  • API 密钥,在 Settings > Agents / Dev 中获取。它以整个工作区的身份操作,可访问下方所有路由。
  • OAuth 访问令牌(以 pos_ 开头),来自 OAuth 应用。它以批准授权的成员身份操作,只能看到该成员的品牌和渠道,并且仅限于其批准的权限范围。
curl https://postnimbo.com/api/public/v1/me \
  -H "Authorization: <api key or pos_ token>"

凭据缺失或错误时返回 401。访问令牌未获批准的路由时返回 403。错误信息包含 msg 或 message 字段。

速率限制

  • 每个 API 密钥或令牌每分钟 120 次请求,所有路由合计。
  • 创建帖子还按工作区限制每小时次数(默认 90 次)。
  • 超出限制时返回 429,并附带以秒为单位的 Retry-After 请求头。请等待相应时间后再重试。

自托管服务器通过 PUBLIC_API_RATE_LIMIT、PUBLIC_API_RATE_TTL 和 API_LIMIT 自行设置限制。

端点

权限范围一栏是 OAuth 令牌所需的权限。API 密钥可访问所有路由。

Account

  • GET/public/v1/me

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

    权限范围任意令牌
  • GET/public/v1/is-connected

    Check that the credential works.

    权限范围任意令牌
  • GET/public/v1/groups

    The brands (customers) the credential can see.

    权限范围任意令牌
  • GET/public/v1/counts

    Posts waiting for approval and unread open inbox conversations.

    权限范围posts:readinbox:read输入query: brandId?

Channels

  • GET/public/v1/integrations

    The connected channels, with their ids and networks.

    权限范围posts:read输入query: 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.

    权限范围API 密钥或完全访问令牌
  • GET/public/v1/find-slot/:id

    The next free posting slot of a channel.

    权限范围posts:read
  • GET/public/v1/social/:integration

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

    权限范围API 密钥或完全访问令牌输入query: refresh? (a channel id to reconnect)
  • DELETE/public/v1/integrations/:id

    Disconnect a channel.

    权限范围API 密钥或完全访问令牌
  • POST/public/v1/integration-trigger/:id

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

    权限范围API 密钥或完全访问令牌输入body: { methodName, data }

Posts

  • GET/public/v1/posts

    The posts between two dates.

    权限范围posts:read输入query: startDate, endDate (ISO 8601), customer?
  • POST/public/v1/posts

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

    权限范围posts:schedule输入body: { 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.

    权限范围API 密钥或完全访问令牌输入body: { settings }
  • PUT/public/v1/posts/:id/status

    Move a post between draft and scheduled.

    权限范围API 密钥或完全访问令牌输入body: { 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.

    权限范围API 密钥或完全访问令牌
  • PUT/public/v1/posts/:id/release-id

    Link a post to the network post it became.

    权限范围API 密钥或完全访问令牌输入body: { releaseId }
  • DELETE/public/v1/posts/:id

    Delete a post.

    权限范围API 密钥或完全访问令牌
  • DELETE/public/v1/posts/group/:group

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

    权限范围API 密钥或完全访问令牌

Media

  • POST/public/v1/upload

    Upload a file to the media library.

    权限范围media:write输入multipart: file, adjust?
  • POST/public/v1/upload-from-url

    Add a file from a public https address.

    权限范围media:write输入body: { url, adjust? }
  • GET/public/v1/media

    The media library, a page at a time.

    权限范围API 密钥或完全访问令牌输入query: page?, search?, folder?
  • GET/public/v1/media/:id/status

    Whether an uploaded video finished processing.

    权限范围API 密钥或完全访问令牌

Ideas

  • POST/public/v1/ideas

    Save an idea to the Ideas board.

    权限范围ideas:write输入body: { title, content? }
  • DELETE/public/v1/ideas/:id

    Remove an idea the credential saved.

    权限范围ideas:write

Analytics

  • GET/public/v1/performance

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

    权限范围analytics:read输入query: brandId?, tz?
  • GET/public/v1/best-times/next

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

    权限范围posts:read输入query: integrationId?, brandId?, tz?, goal?: engagement|reach|views, count? (1-20)
  • GET/public/v1/analytics/:integration

    The analytics of a channel.

    权限范围API 密钥或完全访问令牌输入query: date (days back)
  • GET/public/v1/analytics/post/:postId

    The analytics of one published post.

    权限范围API 密钥或完全访问令牌输入query: date (days back)

AI

  • POST/public/v1/ai/draft

    Draft a post about a web page with PostNimbo AI.

    权限范围ai:use输入body: { url, title?, selection?, mode: summary|captions }
  • POST/public/v1/ai/reply

    Draft a reply to a comment or message.

    权限范围ai:use输入body: { text, url? }

Link in bio

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

    The link-in-bio pages of the workspace.

    权限范围link-in-bio:write
  • POST/public/v1/link-in-bio/:id/links

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

    权限范围link-in-bio:write输入body: { label, url }

Video and clipping

  • POST/public/v1/generate-video

    Generate a video with one of the AI video tools.

    权限范围API 密钥或完全访问令牌
  • POST/public/v1/video/function

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

    权限范围API 密钥或完全访问令牌
  • POST/public/v1/clipping

    Cut a long video into short clips.

    权限范围API 密钥或完全访问令牌
  • GET/public/v1/clipping

    The clipping jobs, a page at a time.

    权限范围API 密钥或完全访问令牌输入query: page
  • GET/public/v1/clipping/:id

    One clipping job and its clips.

    权限范围API 密钥或完全访问令牌

Notifications

  • GET/public/v1/notifications

    The workspace notifications, a page at a time.

    权限范围API 密钥或完全访问令牌输入query: page?

Webhooks

  • GET/public/v1/webhooks/events

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

    权限范围任意令牌
  • GET/public/v1/webhooks

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

    权限范围webhooks:write输入query: url?
  • POST/public/v1/webhooks

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

    权限范围webhooks:write输入body: { url, events?, integrations? (channel ids), name? }
  • DELETE/public/v1/webhooks/:id

    Remove a webhook (how a trigger switches off).

    权限范围webhooks:write

正在用 PostNimbo 构建产品?

告诉我们你在做什么。我们会协助你使用 API,审核应用以收录到目录,并添加集成所需的端点。