JSON-RPC API
This page shows the default built-in API (security related mainly).
API
Methods
hcms.security.login
Parameter structure: either.
Logs in creating an access token.
Parameters:
-
username
(string
) -
password
(string
)
hcms.security.refresh
Parameter structure: either.
Refreshes a token.
Parameters:
-
token
(string
)
Schemas
Token (io.yupiik.hcms.jsonrpc.model.Token) schema
Name | Type | Nullable | Description |
---|---|---|---|
access_token |
string |
true |
Actual token to call resources. |
expires_in |
integer |
false |
Expiration duration - advice: never use it and prefer the expiry date in the payload of the JWT |
refresh_token |
string |
true |
Refresh token, only usable to get a new token. |
token_type |
string |
true |
Type of token should always be |
JSON
{
"components": {
"schemas": {
"io.yupiik.hcms.jsonrpc.model.Token": {
"title": "Token",
"type": "object",
"properties": {
"access_token": {
"nullable": true,
"description": "Actual token to call resources.",
"type": "string"
},
"expires_in": {
"nullable": false,
"format": "int64",
"description": "Expiration duration - advice: never use it and prefer the expiry date in the payload of the JWT `access_token`/`refresh_token`.",
"type": "integer",
"$id": "number"
},
"refresh_token": {
"nullable": true,
"description": "Refresh token, only usable to get a new token.",
"type": "string"
},
"token_type": {
"nullable": true,
"description": "Type of token should always be `Bearer`.",
"type": "string"
}
},
"$id": "io.yupiik.hcms.jsonrpc.model.Token"
}
}
},
"info": {
"version": "1.2.6",
"title": "Yupiik HCMS API"
},
"methods": [
{
"description": "Logs in creating an access token.",
"errors": [
{
"code": 400,
"message": "Invalid credentials."
},
{
"code": -32700,
"message": "Request deserialization error."
},
{
"code": -32603,
"message": "Exception message, missing JSON-RPC response."
},
{
"code": -32601,
"message": "Unknown JSON-RPC method."
},
{
"code": -32600,
"message": "Invalid request: wrong JSON-RPC version attribute or request JSON type."
},
{
"code": -2,
"message": "Exception message, unhandled exception"
}
],
"name": "hcms.security.login",
"params": [
{
"name": "username",
"schema": {
"nullable": true,
"type": "string"
}
},
{
"name": "password",
"schema": {
"nullable": true,
"type": "string"
}
}
],
"paramStructure": "either",
"result": {
"name": "result",
"schema": {
"$ref": "#/components/schemas/io.yupiik.hcms.jsonrpc.model.Token"
}
},
"summary": "Logs in creating an access token."
},
{
"description": "Refreshes a token.",
"errors": [
{
"code": 400,
"message": "Invalid token."
},
{
"code": 401,
"message": "Invalid authentication."
},
{
"code": -32700,
"message": "Request deserialization error."
},
{
"code": -32603,
"message": "Exception message, missing JSON-RPC response."
},
{
"code": -32601,
"message": "Unknown JSON-RPC method."
},
{
"code": -32600,
"message": "Invalid request: wrong JSON-RPC version attribute or request JSON type."
},
{
"code": -2,
"message": "Exception message, unhandled exception"
}
],
"name": "hcms.security.refresh",
"params": [
{
"name": "token",
"schema": {
"nullable": true,
"type": "string"
}
}
],
"paramStructure": "either",
"result": {
"name": "result",
"schema": {
"$ref": "#/components/schemas/io.yupiik.hcms.jsonrpc.model.Token"
}
},
"summary": "Refreshes a token."
}
],
"openrpc": "1.2.6",
"servers": [
{
"url": "http://localhost:8080"
}
]
}