🚀 1단계: Authorization Code 발급
📝 URL 생성
https://threads.net/oauth/authorize?client_id=[CLIENT_ID]&redirect_uri=[REDIRECT_URI]&scope=threads_basic,threads_content_publish,threads_delete,threads_keyword_search,threads_location_tagging,threads_manage_insights,threads_manage_mentions,threads_manage_replies,threads_profile_discovery,threads_read_replies&response_type=code
🔧 실제 예시
https://threads.net/oauth/authorize?client_id=1345910000106038&redirect_uri=https://ravinewing.kr&scope=threads_basic,threads_content_publish,threads_delete,threads_keyword_search,threads_location_tagging,threads_manage_insights,threads_manage_mentions,threads_manage_replies,threads_profile_discovery,threads_read_replies&response_type=code
⚡ 실행 방법
- (크롬 시크릿)브라우저 주소창에 위 URL 붙여넣기
- Threads 계정으로 로그인
- “앱 권한 허용” 버튼 클릭
- 리디렉션된 URL에서 code 파라미터 복사
📍 결과 확인
리디렉션 URL: https://daontd.com?code=AQBx-hBsH3abc123def456ghi789#_
Authorization Code: AQBx-hBsH3abc123def456ghi789
⚠️ 뒤의
#_는 제외하고 복사🔥 2단계: Short-lived Access Token 발급
📨 Postman 설정
- 메소드: POST
- URL:
https://graph.threads.net/oauth/access_token - Body 타입: form-data
📋 Body Parameters
| Key | Value |
|---|---|
client_id |
[CLIENT_ID] |
client_secret |
[CLIENT_SECRET] |
grant_type |
authorization_code |
redirect_uri |
[REDIRECT_URI] |
code |
[1단계에서 받은 Authorization Code] |
✅ 성공 응답
{
“access_token”: “THQVJ1234567890abcdef…”,
“user_id”: “17841405793187218”
}
“access_token”: “THQVJ1234567890abcdef…”,
“user_id”: “17841405793187218”
}
💾 저장할 정보
access_token: 3단계에서 사용user_id: 게시할 때 계속 필요
🎯 3단계: Long-lived Access Token 변환
📨 Postman 설정
- 메소드: GET
- URL:
https://graph.threads.net/access_token - Body 타입: Params
📋 Query Parameters
| Key | Value |
|---|---|
grant_type |
th_exchange_token |
client_secret |
[CLIENT_SECRET] |
access_token |
[2단계에서 받은 Short-lived Token] |
✅ 성공 응답
{
“access_token”: “새로운_60일짜리_토큰…”,
“token_type”: “bearer”,
“expires_in”: 5184000
}
“access_token”: “새로운_60일짜리_토큰…”,
“token_type”: “bearer”,
“expires_in”: 5184000
}
🎊 최종 토큰 획득!
expires_in: 5184000= 60일- 이 토큰을 안전하게 보관하세요!