system/AdminImiRequests

Collection of requests to connect chats to the administrator bot. A request is created by the /start command from an unconnected chat; the bot sends a 6-digit connection code to the chat. The master domain administrator confirms the connection by writing the code to the confirmCode field:

PATCH /rest/v1/model/system/AdminImiRequests/<id>
{"confirmCode": "123456"}

With a correct code, the service creates an system/AdminImiSubscribers entity on behalf of the user who entered the code and deletes the request. After three incorrect codes the request is rejected.

Created and used by the mware microservice.

Contained only in the master domain.

Storage type: runtime. The request is deleted 10 minutes after the last modification.

Table 1. Class fields
Field Description

id

Identifier, matches remoteParty_id. A repeated /start command from the chat replaces the request.

account_id

Messenger account (bot), im/Accounts collection.

remoteParty_id

Chat, im/RemoteParties collection.

channel

Messenger type.

displayName

Interlocutor name in the messenger.

codeHash

Connection code hash. The code itself is not stored.

confirmCode

Connection code entered by the administrator. The service clears the field after verification.

attempts

Number of incorrect codes.

status

pending — awaiting confirmation, rejected — rejected.

ts, ttl

Last modification time and lifetime (seconds).