Exchange authorization code for OAuth token
curl --request POST \
--url https://mcp.echozero.app/oauth/token \
--header 'Content-Type: application/json' \
--header 'x-signature: <x-signature>' \
--header 'x-timestamp: <x-timestamp>' \
--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 = {
"x-signature": "<x-signature>",
"x-timestamp": "<x-timestamp>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-signature': '<x-signature>',
'x-timestamp': '<x-timestamp>',
'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: {
'x-signature': '<x-signature>',
'x-timestamp': '<x-timestamp>',
'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("x-signature", "<x-signature>")
req.Header.Add("x-timestamp", "<x-timestamp>")
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' \
--header 'x-signature: <x-signature>' \
--header 'x-timestamp: <x-timestamp>' \
--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 = {
"x-signature": "<x-signature>",
"x-timestamp": "<x-timestamp>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-signature': '<x-signature>',
'x-timestamp': '<x-timestamp>',
'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: {
'x-signature': '<x-signature>',
'x-timestamp': '<x-timestamp>',
'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("x-signature", "<x-signature>")
req.Header.Add("x-timestamp", "<x-timestamp>")
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
Required for API-key authenticated requests. HMAC-SHA256(secretKey, timestamp + METHOD + path + body) as lowercase hex. Omit only for JWT/OAuth session tokens or public routes.
Required with x-signature. Epoch milliseconds; rejected if drift exceeds 5 minutes. Omit only for JWT/OAuth session tokens or public routes.
Body
application/json
Response
201