curl --request GET \
--url https://api.royalti.io/auth/authtoken \
--header 'Authorization: Bearer <token>'{
"status": "success",
"message": "Access token generated for Royalty-demo",
"data": {
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjRlNDI3MjllLWYxNGQtNDhlNy1iNGNiLWMxODliNmQxNThlNiIsIm5hbWUiOiJhZG1pbiB1c2VyIiwiYWN0aXZlV29ya3NwYWNlIjoiNzg2YWNkZjctZmEzZS00YWIyLTkxZDUtMTNmMGI2YThhZDk3IiwiaWF0IjoxNzA3MzAwODU1LCJleHAiOjE3MDczMjI0NTV9.GxYzQmRNHsZBEiEDYy4X6FYmjuBkKVZqnAse4CMdtkw"
}
}/auth/authtoken
curl --request GET \
--url https://api.royalti.io/auth/authtoken \
--header 'Authorization: Bearer <token>'{
"status": "success",
"message": "Access token generated for Royalty-demo",
"data": {
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjRlNDI3MjllLWYxNGQtNDhlNy1iNGNiLWMxODliNmQxNThlNiIsIm5hbWUiOiJhZG1pbiB1c2VyIiwiYWN0aXZlV29ya3NwYWNlIjoiNzg2YWNkZjctZmEzZS00YWIyLTkxZDUtMTNmMGI2YThhZDk3IiwiaWF0IjoxNzA3MzAwODU1LCJleHAiOjE3MDczMjI0NTV9.GxYzQmRNHsZBEiEDYy4X6FYmjuBkKVZqnAse4CMdtkw"
}
}/auth/authtoken endpoint allows users to obtain a new access token, typically used for authentication purposes.
This endpoint also allows user to switch between multiple workspaces.
Method:| Parameter | Type | Description | Required |
|---|---|---|---|
| currentWorkspace | string | The identifier for the current workspace | No |
| userId | string | The ID of the user to get token for | No |
const response = await fetch('https://api.royalti.io/auth/authtoken', {
method: 'GET',
headers: {
'Authorization': `Bearer ${token}`,
},
});
const data = await response.json();
console.log(data);