토큰 발급 / 갱신
curl --request POST \
--url https://openapi.rocketpunch.com/oauth/token \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data grant_type=authorization_code \
--data 'code=<string>' \
--data redirect_uri=https://builder.example.com/callback \
--data 'code_verifier=<string>' \
--data 'client_id=<string>' \
--data 'client_secret=<string>'import requests
url = "https://openapi.rocketpunch.com/oauth/token"
payload = {
"grant_type": "authorization_code",
"code": "<string>",
"redirect_uri": "https://builder.example.com/callback",
"code_verifier": "<string>",
"client_id": "<string>",
"client_secret": "<string>"
}
headers = {"Content-Type": "application/x-www-form-urlencoded"}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/x-www-form-urlencoded'},
body: new URLSearchParams({
grant_type: 'authorization_code',
code: '<string>',
redirect_uri: 'https://builder.example.com/callback',
code_verifier: '<string>',
client_id: '<string>',
client_secret: '<string>'
})
};
fetch('https://openapi.rocketpunch.com/oauth/token', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://openapi.rocketpunch.com/oauth/token",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "grant_type=authorization_code&code=%3Cstring%3E&redirect_uri=https%3A%2F%2Fbuilder.example.com%2Fcallback&code_verifier=%3Cstring%3E&client_id=%3Cstring%3E&client_secret=%3Cstring%3E",
CURLOPT_HTTPHEADER => [
"Content-Type: application/x-www-form-urlencoded"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://openapi.rocketpunch.com/oauth/token"
payload := strings.NewReader("grant_type=authorization_code&code=%3Cstring%3E&redirect_uri=https%3A%2F%2Fbuilder.example.com%2Fcallback&code_verifier=%3Cstring%3E&client_id=%3Cstring%3E&client_secret=%3Cstring%3E")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://openapi.rocketpunch.com/oauth/token")
.header("Content-Type", "application/x-www-form-urlencoded")
.body("grant_type=authorization_code&code=%3Cstring%3E&redirect_uri=https%3A%2F%2Fbuilder.example.com%2Fcallback&code_verifier=%3Cstring%3E&client_id=%3Cstring%3E&client_secret=%3Cstring%3E")
.asString();require 'uri'
require 'net/http'
url = URI("https://openapi.rocketpunch.com/oauth/token")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/x-www-form-urlencoded'
request.body = "grant_type=authorization_code&code=%3Cstring%3E&redirect_uri=https%3A%2F%2Fbuilder.example.com%2Fcallback&code_verifier=%3Cstring%3E&client_id=%3Cstring%3E&client_secret=%3Cstring%3E"
response = http.request(request)
puts response.read_body{
"access_token": "eyJhbGciOiJSUzI1NiJ9...",
"token_type": "Bearer",
"expires_in": 3600,
"refresh_token": "rt_a1b2c3d4...",
"scope": "profile:read"
}{
"error": "invalid_grant",
"error_description": "Authorization code expired or already used."
}{
"error": "invalid_grant",
"error_description": "Authorization code expired or already used."
}{
"code": "C0005",
"message": "요청 값이 올바르지 않습니다.",
"timestamp": "2026-05-20T09:00:00",
"details": "startDate"
}{
"error": "invalid_grant",
"error_description": "Authorization code expired or already used."
}OAuth Token
토큰 발급 / 갱신
사용자 컨텍스트 access token 을 발급·갱신한다. grant_type=authorization_code 면 /oauth/authorize 에서 받은 code + PKCE code_verifier 로 최초 발급하고, grant_type=refresh_token 이면 refresh_token 으로 재발급한다. 응답 access_token 은 Authorization: Bearer <jwt> 형식으로 사용자 컨텍스트 /api/v1/** 및 /oauth/userinfo 호출에 사용한다. 클라이언트 인증은 HTTP Basic 또는 본문의 client_id/client_secret.
POST
/
oauth
/
token
토큰 발급 / 갱신
curl --request POST \
--url https://openapi.rocketpunch.com/oauth/token \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data grant_type=authorization_code \
--data 'code=<string>' \
--data redirect_uri=https://builder.example.com/callback \
--data 'code_verifier=<string>' \
--data 'client_id=<string>' \
--data 'client_secret=<string>'import requests
url = "https://openapi.rocketpunch.com/oauth/token"
payload = {
"grant_type": "authorization_code",
"code": "<string>",
"redirect_uri": "https://builder.example.com/callback",
"code_verifier": "<string>",
"client_id": "<string>",
"client_secret": "<string>"
}
headers = {"Content-Type": "application/x-www-form-urlencoded"}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/x-www-form-urlencoded'},
body: new URLSearchParams({
grant_type: 'authorization_code',
code: '<string>',
redirect_uri: 'https://builder.example.com/callback',
code_verifier: '<string>',
client_id: '<string>',
client_secret: '<string>'
})
};
fetch('https://openapi.rocketpunch.com/oauth/token', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://openapi.rocketpunch.com/oauth/token",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "grant_type=authorization_code&code=%3Cstring%3E&redirect_uri=https%3A%2F%2Fbuilder.example.com%2Fcallback&code_verifier=%3Cstring%3E&client_id=%3Cstring%3E&client_secret=%3Cstring%3E",
CURLOPT_HTTPHEADER => [
"Content-Type: application/x-www-form-urlencoded"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://openapi.rocketpunch.com/oauth/token"
payload := strings.NewReader("grant_type=authorization_code&code=%3Cstring%3E&redirect_uri=https%3A%2F%2Fbuilder.example.com%2Fcallback&code_verifier=%3Cstring%3E&client_id=%3Cstring%3E&client_secret=%3Cstring%3E")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://openapi.rocketpunch.com/oauth/token")
.header("Content-Type", "application/x-www-form-urlencoded")
.body("grant_type=authorization_code&code=%3Cstring%3E&redirect_uri=https%3A%2F%2Fbuilder.example.com%2Fcallback&code_verifier=%3Cstring%3E&client_id=%3Cstring%3E&client_secret=%3Cstring%3E")
.asString();require 'uri'
require 'net/http'
url = URI("https://openapi.rocketpunch.com/oauth/token")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/x-www-form-urlencoded'
request.body = "grant_type=authorization_code&code=%3Cstring%3E&redirect_uri=https%3A%2F%2Fbuilder.example.com%2Fcallback&code_verifier=%3Cstring%3E&client_id=%3Cstring%3E&client_secret=%3Cstring%3E"
response = http.request(request)
puts response.read_body{
"access_token": "eyJhbGciOiJSUzI1NiJ9...",
"token_type": "Bearer",
"expires_in": 3600,
"refresh_token": "rt_a1b2c3d4...",
"scope": "profile:read"
}{
"error": "invalid_grant",
"error_description": "Authorization code expired or already used."
}{
"error": "invalid_grant",
"error_description": "Authorization code expired or already used."
}{
"code": "C0005",
"message": "요청 값이 올바르지 않습니다.",
"timestamp": "2026-05-20T09:00:00",
"details": "startDate"
}{
"error": "invalid_grant",
"error_description": "Authorization code expired or already used."
}헤더
Basic base64(client_id:client_secret) — form 의 client_id/client_secret 사용 시 생략 가능
응답 지원 로케일: ko, en, ja, zh-CN, zh-TW, es, fr, de, pt, th, vi. 미지정 시 ko 기본값
예시:
"ko"
본문
application/x-www-form-urlencoded
- Option 1
- Option 2
grant_type=authorization_code 토큰 교환 요청
사용 가능한 옵션:
authorization_code 예시:
"authorization_code"
GET /oauth/authorize 응답으로 받은 1회용 코드
authorize 단계와 글자 단위로 동일
예시:
"https://builder.example.com/callback"
PKCE verifier (43–128자, [A-Za-z0-9._~-])
Required string length:
43 - 128Basic Auth 사용 시 생략 가능
Basic Auth 사용 시 생략 가능
이 페이지가 도움이 되었나요?
⌘I