본문으로 건너뛰기
개발자

OAuth 앱

다른 PostNimbo 사용자가 내 제품을 연결하게 하세요. 사용자는 로그인해 요청 내용을 확인하고 승인하며, Settings > Apps에서 언제든 해제할 수 있습니다.

앱 만들기

  1. 1PostNimbo에서 Settings > Apps를 열고 이름, 설명, 이미지, 리디렉션 주소를 입력해 OAuth 앱을 만드세요.
  2. 2클라이언트 id와 클라이언트 시크릿을 복사하세요. 시크릿은 서버에 보관하고, 유출되면 같은 페이지에서 교체하세요.

인증 코드 플로우

클라이언트 id, 리디렉션 주소, state 값과 함께 멤버를 동의 화면으로 보내세요. PKCE S256 챌린지는 모든 앱에 권장되며, 시크릿을 보관할 수 없는 앱에는 필수입니다.

1. 동의 화면 열기
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를 교환하세요.

2. 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>
3. 응답
{
  "access_token": "pos_…",
  "token_type": "bearer",
  "scope": "posts:read posts:schedule"
}

REST API의 Authorization 헤더에 액세스 토큰을 넣어 보내세요. 멤버가 앱을 해제할 때까지 유효하니 암호화해 저장하세요.

스코프

앱이 실제로 사용하는 스코프만 요청하세요. 동의 화면에 각 스코프가 아래 문구로 표시됩니다. 아무 스코프도 요청하지 않으면 토큰이 전체 접근 권한을 가지므로 스코프를 지정하는 것이 좋습니다.

  • ideas:writeSave ideas to your Ideas board, and remove ideas you saved (Undo)
  • media:writeAdd images to your media library
  • posts:readSee your brands, channels, scheduled posts and the posts waiting for approval
  • posts: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 features
  • link-in-bio:writeAdd links to your link-in-bio pages
  • analytics:readSee a summary of your analytics
  • inbox:readSee how many inbox conversations are unread
  • webhooks: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

토큰으로 할 수 있는 일

  • 승인한 멤버의 권한으로 동작합니다. 해당 멤버의 브랜드와 채널, 그리고 워크스페이스가 부여한 채널 권한 수준까지만 사용할 수 있습니다.
  • 워크스페이스에 승인 절차가 있으면, 토큰으로 예약한 게시물도 멤버가 직접 만든 게시물처럼 승인자를 기다립니다.
  • 스코프 밖의 경로는 403을 반환합니다. 권한을 더 받으려면 멤버에게 다시 로그인하도록 요청하세요.

PostNimbo로 무언가를 만들고 계신가요?

만들고 있는 것을 알려 주세요. API 사용을 돕고, 디렉터리 등록용 앱을 검토하며, 연동에 필요한 엔드포인트를 추가합니다.