Exchange authorization code for API key
curl --request POST \
--url https://nemonist.com/api/v1/auth/keys \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"code": "auth_code_abc123def456",
"code_challenge_method": "S256",
"code_verifier": "dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk"
}
'import requests
url = "https://nemonist.com/api/v1/auth/keys"
payload = {
"code": "auth_code_abc123def456",
"code_challenge_method": "S256",
"code_verifier": "dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
code: 'auth_code_abc123def456',
code_challenge_method: 'S256',
code_verifier: 'dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk'
})
};
fetch('https://nemonist.com/api/v1/auth/keys', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"key": "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",
"user_id": "user_2yOPcMpKoQhcd4bVgSMlELRaIah"
}{
"error": {
"code": 400,
"message": "Invalid request parameters"
}
}{
"error": {
"code": 403,
"message": "Only management keys can perform this operation"
}
}{
"error": {
"code": 500,
"message": "Internal Server Error"
}
}{
"error": {
"code": 500,
"message": "Internal Server Error"
}
}OAuth
Exchange authorization code for API key
Exchange an authorization code from the PKCE flow for a user-controlled API key
POST
/
auth
/
keys
Exchange authorization code for API key
curl --request POST \
--url https://nemonist.com/api/v1/auth/keys \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"code": "auth_code_abc123def456",
"code_challenge_method": "S256",
"code_verifier": "dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk"
}
'import requests
url = "https://nemonist.com/api/v1/auth/keys"
payload = {
"code": "auth_code_abc123def456",
"code_challenge_method": "S256",
"code_verifier": "dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
code: 'auth_code_abc123def456',
code_challenge_method: 'S256',
code_verifier: 'dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk'
})
};
fetch('https://nemonist.com/api/v1/auth/keys', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"key": "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",
"user_id": "user_2yOPcMpKoQhcd4bVgSMlELRaIah"
}{
"error": {
"code": 400,
"message": "Invalid request parameters"
}
}{
"error": {
"code": 403,
"message": "Only management keys can perform this operation"
}
}{
"error": {
"code": 500,
"message": "Internal Server Error"
}
}{
"error": {
"code": 500,
"message": "Internal Server Error"
}
}Authorizations
Headers
Body
application/json