Patrick Schurig b26274595c
Some checks failed
Build & Deploy docs / build-deploy (push) Failing after 10m17s
feat: référence API JsonRPC générée depuis introspect.json
- Nouveau générateur scripts/gen_api_reference.py : 19 namespaces →
  docs/api/metier/ (10) + docs/api/systeme/ (9) + notifications.md +
  types.md (96 types · 55 enums · 4 flags) + SUMMARY.md literate-nav
- Badges permissionScope (perm-none/control/configure/admin) dans extra.css
- Guide docs/integrations/jsonrpc-api.md (connexion TCP/WS, auth, conventions énergie)
- mkdocs.yml : Référence API dans la nav, REST→JsonRPC renommé
- mkdocs build --strict : 0 warnings · --check idempotent

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-04 08:15:37 +02:00

211 lines
7.3 KiB
Markdown

# JSONRPC
<!-- BEGIN GENERATED: __api_JSONRPC__ -->
## Méthodes
### JSONRPC.Authenticate
<span class="badge perm-none">PUBLIC</span>
Authenticate a client to the api via user & password challenge. Provide a device name which allows the user to identify the client and revoke the token in case the device is lost or stolen. This will return a new token to be used to authorize a client at the API.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `deviceName` | `String` | |
| `password` | `String` | |
| `username` | `String` | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `scopes` | [PermissionScopes](../types.md#permissionscopes) | optionnel |
| `token` | `String` | optionnel |
| `username` | `String` | optionnel |
| `success` | `Bool` | |
---
### JSONRPC.CreateUser
<span class="badge perm-admin">ADMIN</span>
Create a new user in the API. This is only allowed to be called when the initial setup is required. To create additional users, use Users.CreateUser instead. Call Authenticate after this to obtain a device token for the newly created user.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `displayName` | `String` | optionnel |
| `email` | `String` | optionnel |
| `password` | `String` | |
| `username` | `String` | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `error` | [UserError](../types.md#usererror) | |
---
### JSONRPC.Hello
<span class="badge perm-none">PUBLIC</span>
Initiates a connection. Use this method to perform an initial handshake of the connection. Optionally, a parameter "locale" is can be passed to set up the used locale for this connection. Strings such as ThingClass displayNames etc will be localized to this locale. If this parameter is omitted, the default system locale (depending on the configuration) is used. The reply of this method contains information about this core instance such as version information, uuid and its name. The locale valueindicates the locale used for this connection. Note: This method can be called multiple times. The locale used in the last call for this connection will be used. Other values, like initialSetupRequired might change if the setup has been performed in the meantime.
The field cacheHashes may contain a map of methods and MD5 hashes. As long as the hash for a method does not change, a client may use a previously cached copy of the call instead of fetching the content again. While the Hello call doesn't necessarily require a token, this can be called with a token. If a token is provided, it will be verified and the reply contains information about the tokens validity and the user and permissions for the given token.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `locale` | `String` | optionnel |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `authenticationRequired` | `Bool` | |
| `initialSetupRequired` | `Bool` | |
| `language` | `String` | |
| `locale` | `String` | |
| `name` | `String` | |
| `authenticated` | `Bool` | optionnel |
| `cacheHashes` | [CacheHash](../types.md#cachehash)[] | optionnel |
| `experiences` | [Experience](../types.md#experience)[] | optionnel |
| `permissionScopes` | [PermissionScopes](../types.md#permissionscopes) | optionnel |
| `username` | `String` | optionnel |
| `protocol version` | `String` | |
| `pushButtonAuthAvailable` | `Bool` | |
| `server` | `String` | |
| `uuid` | `Uuid` | |
| `version` | `String` | |
---
### JSONRPC.Introspect
<span class="badge perm-none">PUBLIC</span>
Introspect this API.
**Paramètres :**
_Aucun paramètre._
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `methods` | `Object` | |
| `notifications` | `Object` | |
| `types` | `Object` | |
---
### JSONRPC.KeepAlive
<span class="badge perm-none">PUBLIC</span>
This is basically a Ping/Pong mechanism a client app may use to check server connectivity. Currently, the server does not actually do anything with this information and will return the call providing the given sessionId back to the caller. It is up to the client whether to use this or not and not required by the server to keep the connection alive.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `sessionId` | `String` | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `sessionId` | `String` | |
| `success` | `Bool` | |
---
### JSONRPC.RequestPushButtonAuth
<span class="badge perm-none">PUBLIC</span>
Authenticate a client to the api via Push Button method. Provide a device name which allows the user to identify the client and revoke the token in case the device is lost or stolen. If push button hardware is available, this will return with success and start listening for push button presses. When the push button is pressed, the PushButtonAuthFinished notification will be sent to the requesting client. The procedure will be cancelled when the connection is interrupted. If another client requests push button authentication while a procedure is still going on, the second call will take over and the first one will be notified by the PushButtonAuthFinished signal about the error. The application should make it clear to the user to not press the button when the procedure fails as this can happen for 2 reasons: a) a second user is trying to auth at the same time and only the currently active user should press the button or b) it might indicate an attacker trying to take over and snooping in for tokens.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `deviceName` | `String` | |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `success` | `Bool` | |
| `transactionId` | `Int` | |
---
### JSONRPC.SetNotificationStatus
<span class="badge perm-none">PUBLIC</span>
Enable/Disable notifications for this connections. Either "enabled" or "namespaces" needs to be given but not both of them. The boolean based "enabled" parameter will enable/disable all notifications at once. If instead the list-based "namespaces" parameter is provided, all given namespaceswill be enabled, the others will be disabled. The return value of "success" will indicate success of the operation. The "enabled" property in the return value is deprecated and used for legacy compatibilty only. It will be set to true if at least one namespace has been enabled.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `d:o:enabled` | `Bool` | |
| `namespaces` | `StringList` | optionnel |
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `d:enabled` | `Bool` | |
| `namespaces` | `StringList` | |
---
### JSONRPC.Version
<span class="badge perm-none">PUBLIC</span>
Version of this nymea/JSONRPC interface.
**Paramètres :**
_Aucun paramètre._
**Retour :**
| Champ | Type | Notes |
| --- | --- | --- |
| `protocol version` | `String` | |
| `qtBuildVersion` | `String` | |
| `qtVersion` | `String` | |
| `version` | `String` | |
---
## Notifications
### JSONRPC.PushButtonAuthFinished
Emitted when a push button authentication reaches final state. NOTE: This notification is special. It will only be emitted to connections that did actively request a push button authentication, but also it will be emitted regardless of the notification settings.
**Paramètres :**
| Champ | Type | Notes |
| --- | --- | --- |
| `token` | `String` | optionnel |
| `success` | `Bool` | |
| `transactionId` | `Int` | |
---
<!-- END GENERATED -->