curl --request GET \
--url 'https://YOURSITE.konstant.ly/openapi/v1/users/1234567890/sso' \
--header 'X-API-KEY: 1qaz2wsx3edc4rfv1qaz2wsx3edc4rfv'
import requests
def get_sso_url(api_key: str, user_id: str) -> str:
url = f"https://YOURSITE.konstant.ly/openapi/v1/users/{user_id}/sso"
headers = {"X-API-KEY": api_key}
response = requests.get(url, headers=headers)
if response.status_code == 404:
raise ValueError(f"User {user_id} not found")
response.raise_for_status()
return response.json()['url']
# Example usage
try:
sso_url = get_sso_url("1qaz2wsx3edc4rfv1qaz2wsx3edc4rfv", "1234567890")
print(f"SSO URL (valid for 30 seconds): {sso_url}")
except Exception as e:
print(f"Failed to get SSO URL: {str(e)}")
const axios = require('axios');
async function getSsoUrl(apiKey, userId) {
try {
const response = await axios.get(
`https://YOURSITE.konstant.ly/openapi/v1/users/${userId}/sso`,
{
headers: {
'X-API-KEY': apiKey
}
}
);
return response.data.url;
} catch (error) {
if (error.response?.status === 404) {
throw new Error(`User ${userId} not found`);
}
throw error;
}
}
// Example usage
getSsoUrl('1qaz2wsx3edc4rfv1qaz2wsx3edc4rfv', '1234567890')
.then(url => {
console.log('SSO URL (valid for 30 seconds):', url);
})
.catch(error => console.error('Failed to get SSO URL:', error.message));
{
"url": "https://YOURSITE.konstant.ly/sso/login/abcdef123456789"
}
{
"status": 404,
"message": "Not found"
}
Users
Get SSO URL
Get SSO (Single Sign-On) URL for a user. Link expires in 30 seconds.
GET
/
users
/
{userId}
/
sso
curl --request GET \
--url 'https://YOURSITE.konstant.ly/openapi/v1/users/1234567890/sso' \
--header 'X-API-KEY: 1qaz2wsx3edc4rfv1qaz2wsx3edc4rfv'
import requests
def get_sso_url(api_key: str, user_id: str) -> str:
url = f"https://YOURSITE.konstant.ly/openapi/v1/users/{user_id}/sso"
headers = {"X-API-KEY": api_key}
response = requests.get(url, headers=headers)
if response.status_code == 404:
raise ValueError(f"User {user_id} not found")
response.raise_for_status()
return response.json()['url']
# Example usage
try:
sso_url = get_sso_url("1qaz2wsx3edc4rfv1qaz2wsx3edc4rfv", "1234567890")
print(f"SSO URL (valid for 30 seconds): {sso_url}")
except Exception as e:
print(f"Failed to get SSO URL: {str(e)}")
const axios = require('axios');
async function getSsoUrl(apiKey, userId) {
try {
const response = await axios.get(
`https://YOURSITE.konstant.ly/openapi/v1/users/${userId}/sso`,
{
headers: {
'X-API-KEY': apiKey
}
}
);
return response.data.url;
} catch (error) {
if (error.response?.status === 404) {
throw new Error(`User ${userId} not found`);
}
throw error;
}
}
// Example usage
getSsoUrl('1qaz2wsx3edc4rfv1qaz2wsx3edc4rfv', '1234567890')
.then(url => {
console.log('SSO URL (valid for 30 seconds):', url);
})
.catch(error => console.error('Failed to get SSO URL:', error.message));
{
"url": "https://YOURSITE.konstant.ly/sso/login/abcdef123456789"
}
{
"status": 404,
"message": "Not found"
}
Generate a temporary SSO URL that allows direct login for a specific user.
Request Headers
API Key. Go to your Konstantly site > Settings > API and copy the value from there.
URL Parameters
User API ID
Response
SSO URL that can be used for direct login. The URL expires in 30 seconds.
Error Responses
curl --request GET \
--url 'https://YOURSITE.konstant.ly/openapi/v1/users/1234567890/sso' \
--header 'X-API-KEY: 1qaz2wsx3edc4rfv1qaz2wsx3edc4rfv'
import requests
def get_sso_url(api_key: str, user_id: str) -> str:
url = f"https://YOURSITE.konstant.ly/openapi/v1/users/{user_id}/sso"
headers = {"X-API-KEY": api_key}
response = requests.get(url, headers=headers)
if response.status_code == 404:
raise ValueError(f"User {user_id} not found")
response.raise_for_status()
return response.json()['url']
# Example usage
try:
sso_url = get_sso_url("1qaz2wsx3edc4rfv1qaz2wsx3edc4rfv", "1234567890")
print(f"SSO URL (valid for 30 seconds): {sso_url}")
except Exception as e:
print(f"Failed to get SSO URL: {str(e)}")
const axios = require('axios');
async function getSsoUrl(apiKey, userId) {
try {
const response = await axios.get(
`https://YOURSITE.konstant.ly/openapi/v1/users/${userId}/sso`,
{
headers: {
'X-API-KEY': apiKey
}
}
);
return response.data.url;
} catch (error) {
if (error.response?.status === 404) {
throw new Error(`User ${userId} not found`);
}
throw error;
}
}
// Example usage
getSsoUrl('1qaz2wsx3edc4rfv1qaz2wsx3edc4rfv', '1234567890')
.then(url => {
console.log('SSO URL (valid for 30 seconds):', url);
})
.catch(error => console.error('Failed to get SSO URL:', error.message));
{
"url": "https://YOURSITE.konstant.ly/sso/login/abcdef123456789"
}
{
"status": 404,
"message": "Not found"
}
Was this page helpful?
⌘I