Exchange authorization code for OAuth token
curl --request POST \
--url https://mcp.echozero.app/oauth/token \
--header 'Content-Type: application/json' \
--data '
{
"grant_type": "authorization_code",
"code": "<string>",
"redirect_uri": "http://127.0.0.1:8765/callback",
"client_id": "echozero-cli",
"code_verifier": "<string>"
}
'import requests
url = "https://mcp.echozero.app/oauth/token"
payload = {
"grant_type": "authorization_code",
"code": "<string>",
"redirect_uri": "http://127.0.0.1:8765/callback",
"client_id": "echozero-cli",
"code_verifier": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
grant_type: 'authorization_code',
code: '<string>',
redirect_uri: 'http://127.0.0.1:8765/callback',
client_id: 'echozero-cli',
code_verifier: '<string>'
})
};
fetch('https://mcp.echozero.app/oauth/token', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
grant_type: 'authorization_code',
code: '<string>',
redirect_uri: 'http://127.0.0.1:8765/callback',
client_id: 'echozero-cli',
code_verifier: '<string>'
})
};
fetch('https://mcp.echozero.app/oauth/token', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://mcp.echozero.app/oauth/token"
payload := strings.NewReader("{\n \"grant_type\": \"authorization_code\",\n \"code\": \"<string>\",\n \"redirect_uri\": \"http://127.0.0.1:8765/callback\",\n \"client_id\": \"echozero-cli\",\n \"code_verifier\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}OAuth
Exchange authorization code for OAuth token
POST
/
oauth
/
token
Exchange authorization code for OAuth token
curl --request POST \
--url https://mcp.echozero.app/oauth/token \
--header 'Content-Type: application/json' \
--data '
{
"grant_type": "authorization_code",
"code": "<string>",
"redirect_uri": "http://127.0.0.1:8765/callback",
"client_id": "echozero-cli",
"code_verifier": "<string>"
}
'import requests
url = "https://mcp.echozero.app/oauth/token"
payload = {
"grant_type": "authorization_code",
"code": "<string>",
"redirect_uri": "http://127.0.0.1:8765/callback",
"client_id": "echozero-cli",
"code_verifier": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
grant_type: 'authorization_code',
code: '<string>',
redirect_uri: 'http://127.0.0.1:8765/callback',
client_id: 'echozero-cli',
code_verifier: '<string>'
})
};
fetch('https://mcp.echozero.app/oauth/token', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
grant_type: 'authorization_code',
code: '<string>',
redirect_uri: 'http://127.0.0.1:8765/callback',
client_id: 'echozero-cli',
code_verifier: '<string>'
})
};
fetch('https://mcp.echozero.app/oauth/token', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://mcp.echozero.app/oauth/token"
payload := strings.NewReader("{\n \"grant_type\": \"authorization_code\",\n \"code\": \"<string>\",\n \"redirect_uri\": \"http://127.0.0.1:8765/callback\",\n \"client_id\": \"echozero-cli\",\n \"code_verifier\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}Headers
HMAC-SHA256 signature: HMAC-SHA256(secretKey, timestamp + METHOD + path + body). Required for API-key authenticated requests (JWT/OAuth session auth is exempt).
Request timestamp in epoch milliseconds. Required with x-signature for API-key auth. Rejected if drift exceeds 5 minutes.
Body
application/json
Response
201 - undefined
⌘I