Tokens REST API Documentation
This document contains the HTTP REST API documentation for the tokens
app. For general information on REST API usage in SODAR Core, see
REST API Overview.
Tokens REST API Versioning
- Media Type
application/vnd.bihealth.sodar-core.tokens+json- Current Version
1.0- Accepted Versions
1.0- Header Example
Accept: application/vnd.bihealth.sodar-core.tokens+json; version=x.y
Tokens REST API Views
- class tokens.views_api.TokenCreateLoginAPIView(**kwargs)[source]
Create and return an API access token for a user logging in with basic authentication. Deletes any previously existing tokens for the user.
The returned token string is only visible once and should be stored upon retrieval.
URL:
/tokens/api/loginMethods:
POSTParameters:
expiry: Token expiration time in hours (integer, optional)sodar_label: Token text label (string, optional, max. 256 characters)
Returns:
delete_count: Number of deleted previous tokens for the user (integer)expiry: Expiry datetime for token (YYYY-MM-DDThh:mm:ssZ or None)sodar_label: Token text label (string)token: One-time visible API token (string)user_uuidUsersodar_uuidvalue (string)