OAuth
Swap a code or refresh token
POST
/
v1
/
oauth
/
token
Swap a code or refresh token
curl --request POST \
--url https://api.sempera.org/v1/oauth/token \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/x-www-form-urlencoded'import requests
url = "https://api.sempera.org/v1/oauth/token"
payload = {}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/x-www-form-urlencoded"
}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: 'Basic <encoded-value>',
'Content-Type': 'application/x-www-form-urlencoded'
},
body: new URLSearchParams({})
};
fetch('https://api.sempera.org/v1/oauth/token', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"access_token": "<string>",
"token_type": "Bearer",
"expires_in": 123,
"refresh_token": "<string>",
"scope": "<string>"
}{
"error": "<string>",
"error_description": "<string>"
}{
"error": "<string>",
"error_description": "<string>"
}{
"error": {
"code": "AGENT_ENV_UNPINNED",
"message": "<string>",
"request_id": "<string>",
"field": "<string>",
"scope": "<string>",
"reason": "<string>"
}
}{
"error": "<string>",
"error_description": "<string>"
}Authorizations
Confidential OAuth client credentials.
Body
application/x-www-form-urlencoded
Authenticate a public client with client_id; confidential clients use body credentials or HTTP Basic. Code exchange requires code, redirect_uri and code_verifier; refresh requires refresh_token.
⌘I
Swap a code or refresh token
curl --request POST \
--url https://api.sempera.org/v1/oauth/token \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/x-www-form-urlencoded'import requests
url = "https://api.sempera.org/v1/oauth/token"
payload = {}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/x-www-form-urlencoded"
}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: 'Basic <encoded-value>',
'Content-Type': 'application/x-www-form-urlencoded'
},
body: new URLSearchParams({})
};
fetch('https://api.sempera.org/v1/oauth/token', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"access_token": "<string>",
"token_type": "Bearer",
"expires_in": 123,
"refresh_token": "<string>",
"scope": "<string>"
}{
"error": "<string>",
"error_description": "<string>"
}{
"error": "<string>",
"error_description": "<string>"
}{
"error": {
"code": "AGENT_ENV_UNPINNED",
"message": "<string>",
"request_id": "<string>",
"field": "<string>",
"scope": "<string>",
"reason": "<string>"
}
}{
"error": "<string>",
"error_description": "<string>"
}