דילוג לתוכן
מפתחים

תיעוד REST API

כל מה שתחת ‎/public/v1, שנוצר מהנתיבים שבאמת קיימים בשרת. JSON נכנס, JSON יוצא.

כתובת בסיס

שלחו כל בקשה לכתובת הזו. PostNimbo באחסון עצמי משתמש בכתובת ה-backend שלו במקום.

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

אימות

שימו את פרטי ההזדהות בכותרת Authorization כמו שהם, בלי הקידומת Bearer. שני סוגים עובדים:

  • מפתח API, מ-הגדרות > סוכנים / Dev. הוא פועל בשם סביבת העבודה כולה ומגיע לכל הנתיבים שלהלן.
  • טוקן גישה של OAuth (מתחיל ב-pos_), מאפליקציית OAuth. הוא פועל בשם החבר שאישר אותו, רואה רק את המותגים והערוצים שלו, ומוגבל להרשאות שהוא אישר.
curl https://postnimbo.com/api/public/v1/me \
  -H "Authorization: <api key or pos_ token>"

פרטי הזדהות חסרים או שגויים מחזירים 401. נתיב שהטוקן לא אושר עבורו מחזיר 403. שגיאות כוללות שדה msg או message.

מגבלות קצב

  • 120 בקשות בדקה לכל מפתח API או טוקן, בכל הנתיבים.
  • יצירת פוסטים מוגבלת גם לכל סביבת עבודה בכל שעה (90 כברירת מחדל).
  • מעבר למגבלה, התשובה היא 429 עם כותרת Retry-After בשניות. המתינו את הזמן הזה לפני ניסיון נוסף.

שרתים באחסון עצמי מגדירים מגבלות משלהם עם PUBLIC_API_RATE_LIMIT,‏ PUBLIC_API_RATE_TTL ו-API_LIMIT.

נקודות קצה

עמודת ה-scope היא מה שטוקן 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, בודקים אפליקציות עבור הספרייה ומוסיפים את נקודות הקצה שאינטגרציות צריכות.