יצירת האפליקציה
- 1ב-PostNimbo פתחו את הגדרות > אפליקציות וצרו אפליקציית OAuth עם שם, תיאור, תמונה וכתובת הפניה.
- 2העתיקו את ה-client id וה-client secret. שמרו את ה-secret בשרת שלכם; אם הוא דלף, החליפו אותו מאותו עמוד.
תהליך authorization code
שלחו את החבר למסך ההסכמה עם ה-client id שלכם, כתובת ההפניה, ערך state, ו-PKCE S256 challenge, שמומלץ לכל אפליקציה וחובה לאפליקציות שלא יכולות לשמור secret.
https://postnimbo.com/oauth/authorize ?client_id=<client id> &response_type=code &redirect_uri=<your redirect address> &state=<random value> &code_challenge=<base64url(sha256(verifier))> &code_challenge_method=S256 &scope=posts:read posts:schedule
אחרי שהוא מאשר, PostNimbo מפנה לכתובת שלכם עם code ו-state. בדקו את ה-state, ואז החליפו את ה-code תוך כמה דקות:
curl -X POST https://postnimbo.com/api/oauth/token \ -d grant_type=authorization_code \ -d code=<code> \ -d client_id=<client id> \ -d client_secret=<client secret> \ -d code_verifier=<verifier> \ -d redirect_uri=<your redirect address>
{
"access_token": "pos_…",
"token_type": "bearer",
"scope": "posts:read posts:schedule"
}שלחו את טוקן הגישה בכותרת Authorization של ה-REST API. הוא ממשיך לעבוד עד שהחבר מבטל את האפליקציה שלכם; שמרו אותו מוצפן.
הרשאות (Scopes)
בקשו רק את מה שהאפליקציה שלכם משתמשת בו. מסך ההסכמה מציג כל אחד מהם במילים האלה. אם לא מבקשים אף אחד, הטוקן מקבל גישה מלאה, אז עדיף להשתמש ב-scopes.
ideas:writeSave ideas to your Ideas board, and remove ideas you saved (Undo)media:writeAdd images to your media libraryposts:readSee your brands, channels, scheduled posts and the posts waiting for approvalposts:scheduleSchedule posts to your channels (when your workspace asks for approval, your approvers get them first)ai:useWrite drafts with PostNimbo AI, within your plan's AI featureslink-in-bio:writeAdd links to your link-in-bio pagesanalytics:readSee a summary of your analyticsinbox:readSee how many inbox conversations are unreadwebhooks:writeSend an event to an address you choose (like Zapier, Make or n8n) when a post is published, a flow captures a lead (with its email or phone number) or a flow is completed
מה הטוקן יכול לעשות
- הוא פועל בשם החבר שאישר אותו: רק המותגים והערוצים שלו, ורמות הערוצים שסביבת העבודה נתנה לו.
- כשסביבת העבודה דורשת אישור, פוסטים שהוא מתזמן ממתינים למאשרים בדיוק כמו פוסטים של החבר עצמו.
- נתיב מחוץ ל-scopes שלו מחזיר 403. בקשו מהחבר להיכנס שוב כדי להעניק יותר.
