cURL
curl -X POST \
-u "<client_id>:<client_secret>" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "grant_type=client_credentials&scope=clients:write" \
https://api.fitsociety.io/public/v1/oauth/tokenconst options = {
method: 'POST',
headers: {
Authorization: 'Basic <encoded-value>',
'Content-Type': 'application/x-www-form-urlencoded'
},
body: new URLSearchParams({grant_type: 'client_credentials'})
};
fetch('https://api.fitsociety.io/public/v1/oauth/token', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.fitsociety.io/public/v1/oauth/token"
payload = { "grant_type": "client_credentials" }
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/x-www-form-urlencoded"
}
response = requests.post(url, data=payload, headers=headers)
print(response.text){
"access_token": "fspt_0123456789abcdef0123456789abcdef0123456789abcdef",
"token_type": "Bearer",
"expires_in": 3600,
"scope": "clients:write"
}OAuth
Issue a Public API access token
Issues an opaque Bearer access token for server-to-server Public API integrations using the OAuth client credentials grant. Authenticate the client with HTTP Basic auth: Authorization: Basic base64(client_id:client_secret).
POST
/
public
/
v1
/
oauth
/
token
cURL
curl -X POST \
-u "<client_id>:<client_secret>" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "grant_type=client_credentials&scope=clients:write" \
https://api.fitsociety.io/public/v1/oauth/tokenconst options = {
method: 'POST',
headers: {
Authorization: 'Basic <encoded-value>',
'Content-Type': 'application/x-www-form-urlencoded'
},
body: new URLSearchParams({grant_type: 'client_credentials'})
};
fetch('https://api.fitsociety.io/public/v1/oauth/token', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.fitsociety.io/public/v1/oauth/token"
payload = { "grant_type": "client_credentials" }
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/x-www-form-urlencoded"
}
response = requests.post(url, data=payload, headers=headers)
print(response.text){
"access_token": "fspt_0123456789abcdef0123456789abcdef0123456789abcdef",
"token_type": "Bearer",
"expires_in": 3600,
"scope": "clients:write"
}Authorizations
Public API OAuth client credentials for /public/v1/oauth/token. Use client_id as the username and client_secret as the password.
Body
application/x-www-form-urlencoded