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": "pageSize must be 50 or less. Input: 51",
"timestamp": "2026-05-20T09:00:00",
"details": "startDate"
}{
"error": "invalid_grant",
"error_description": "Authorization code expired or already used."
}Issue / refresh token
Issues or refreshes a user-context access token. With grant_type=authorization_code, use the code from /oauth/authorize and the PKCE code_verifier; with grant_type=refresh_token, use the refresh_token. Send the returned access_token as Authorization: Bearer <jwt> for user-context /api/v1/** and /oauth/userinfo calls. Client authentication is HTTP Basic or client_id/client_secret in the request body.
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": "pageSize must be 50 or less. Input: 51",
"timestamp": "2026-05-20T09:00:00",
"details": "startDate"
}{
"error": "invalid_grant",
"error_description": "Authorization code expired or already used."
}Headers
Basic base64(client_id:client_secret) - optional when using client_id/client_secret in the form body
Supported response locales: ko, en, ja, zh-CN, zh-TW, es, fr, de, pt, th, vi. Default is ko.
"ko"
Body
- Option 1
- Option 2
Token exchange request with grant_type=authorization_code
authorization_code "authorization_code"
One-time code received from GET /oauth/authorize
Must exactly match the authorize step
"https://builder.example.com/callback"
PKCE verifier (43-128 characters, [A-Za-z0-9._~-])
43 - 128Optional when using Basic Auth
Optional when using Basic Auth
Response
Token issued successfully
RFC 6749 Section 5.1 token response
Bearer access token (JWT)
"eyJhbGciOiJSUzI1NiJ9..."
Token type - always Bearer
"Bearer"
Access token lifetime in seconds
3600
Plain refresh token (one-time use)
"rt_a1b2c3d4..."
Issued scopes (space-separated)
"profile:read"
Was this page helpful?