On this page
Development API: Gateway API Reference
For browser authorization, permissions and project connections from Codex and other MCP clients, see MCP connection and authorization.
This page summarizes commonly used interfaces for TGateway, Studio, and Watchdog. Sign in and send a valid token when calling protected endpoints. Ordinary Studio language-service requests allow anonymous access; analysis involving project paths still requires authentication.
Reading Objects
This page is not the main reading path for ordinary end users, but rather a reference for system integration and secondary development, used for top-level computers, MES, SCADA, cloud platforms, or self-developed program integration. On-site electrical engineers usually do not need to start with APIs for daily configuration and troubleshooting; For data collection, debugging, data forwarding, and alarm handling, please read the corresponding operation manual first.
Security Boundaries
Interfaces such as writing variables, restarting runtime, modifying networks, adjusting permissions, and importing configurations can affect the field system. Before the integration program goes live, permissions, parameters, error handling, and retry policies should be verified in the test environment, and the minimum necessary permissions should be assigned to production accounts.
Reading path: retrieve the API definition → authentication → API reference → request troubleshooting. MCP is optional; use MCP access and authorization only when choosing that client.
Access and authentication
Interface Terminology Comparison
| Terminology | On-site Understanding |
|---|---|
| Token | The access credential obtained after login, which external systems must carry every time they call the interface. |
| Write variables | Assign values to the external system or page to a point, equivalent to what is commonly called “writing the point backward” on site. |
| Target variable property | An external mapping of a forwarding target to a single variable, such as an external field name, Modbus slave address, sampling policy, or write permission. |
| Forwarding Group Variables | Which variables are actually included in a data forwarding group. Under Manual Selection Range, variables are first added to the forwarding group, and only then will the attributes of the target variable take effect. |
| Topics/paths in message systems such as MQTT and Kafka, topics/paths; external systems receive or subscribe to data under this name. |
Basic Agreements
| Project | Explanation |
|---|---|
| TGateway default address | http://<gateway-ip>:6100 |
| Studio default address | http://<StudioIP>:5100 |
| Watchdog default address | http://<gateway-ip>:6200 |
| Data format | Standard interface uses JSON; File import, upload, and export interfaces use form files or file streams. |
| Authentication Methods | Use Bearer Tokens after logging in; If unauthorized or the token is invalid, you need to log in again. |
| Return Result | Interfaces typically return a unified result structure; the caller should determine success based on status codes and messages. |
Studio and Watchdog listen on 0.0.0.0 by default, and the current version allows clients to call them over standard http://<ip>:<port> addresses. Standard HTTP access requires remote management and AllowInsecureRemoteHttp to be enabled. Watchdog project deployment and process control also require RemoteDeploymentEnabled.
Browser CORS
TGateway Web APIs allow any browser origin by default when CorsOrigins is empty. A configured list matches complete origins, including scheme, host, and nondefault port. A domain suffix, substring, or different port does not match the same origin.
Origin permission and API authorization are separate checks. Protected endpoints still require valid tokens, roles, and API permissions. Send Bearer tokens according to the endpoint contract. Server applications are not governed by browser CORS but must still pass authentication and authorization.
| Service | Origin and authentication contract |
|---|---|
| TGateway Web API | Any origin by default; an explicit list limits matching origins. Endpoint authentication and authorization remain active. |
Studio /api/completion/* | Any origin, method, and request header. Ordinary requests may be anonymous; requests carrying project paths authenticate first. |
| Studio management endpoints | Follow Studio origin, remote-management, and sign-in settings, rather than the anonymous language-service rules. |
The default language address is https://roslyn.thingsgateway.cn; use your own root address for a self-hosted Studio. Reverse proxies must preserve CORS headers and forward OPTIONS preflight or return an equivalent response. HTTP 200 alone does not prove a browser can call the service: check expected JSON, a matching Access-Control-Allow-Origin, and preflight permission for the actual method and headers.
For example, inspect the language service response with the Gateway page’s actual origin:
# 使用实际 Gateway 网页的 Origin 检查响应头及 JSON。
curl -i \
-H 'Origin: http://192.168.10.30:6100' \
https://roslyn.thingsgateway.cn/api/completion/assembliesOrdinary language responses include Access-Control-Allow-Origin: *. This mode does not grant cross-site cookie credentials; callers should not depend on cross-site cookies for authentication. Complete connection, completion, and analysis checks in the real Gateway editor. See Code Editor Operations.
Retrieve OpenAPI JSON
TGateway provides a standard OpenAPI JSON document at the following address:
GET http://<gateway-ip>:6100/api/openapi.jsonYou can also save the document to a local file with curl:
curl http://<gateway-ip>:6100/api/openapi.json -o openapi.jsonThe returned JSON can be imported into Swagger Editor, Postman, or other OpenAPI-compatible clients and code generators. Use the document returned by the target TGateway version as the authoritative interface definition.
Studio and Watchdog Login Password Encryption
Before calling the Studio or Watchdog login API, obtain a temporary public key and encrypt the password:
- Call the corresponding public key endpoint to obtain
keyId,publicKey,algorithm,nonce, andexpiresAt. - Confirm that
algorithmequalsRSA-OAEP-SHA256. - Use the RSA 2048 SubjectPublicKeyInfo DER Base64 public key in the
publicKeyto encrypt the following UTF-8 JSON. Field names are case-fixed.
{
"Password": "The actual password",
"Nonce": "NONCE in public key responses"
}- Encode the RSA-OAEP-SHA256 ciphertext in Base64 as the login request’s
password, and submitkeyIdaspasswordKeyId. - After successful login, subsequent protected requests are uniformly sent
Authorization: Bearer <token>.
The temporary public key expires after two minutes and allows a single login request. It becomes invalid after that request succeeds or fails. Obtain a new public key before retrying. The API accepts only the encrypted format described above.
Browser clients can use node-forge to execute RSA-OAEP-SHA256 on a regular HTTP IP page and generate OAEP random seeds using crypto.getRandomValues; Do not rely on the crypto.subtle.importKey, which is usually unavailable in this scenario.
HTTP security boundaries
Login password encryption protects only the password field. With plain HTTP, access tokens, password change requests, project packages, backups, and other business data are still sent without transport encryption. Use HTTPS on public or untrusted networks.
TGateway Authentication Interface
| Method | Path | Purpose |
|---|---|---|
| GET | /api/auth/GetLoginPasswordPublicKey | Get login password encryption public key |
| POST | /api/auth/Login | User login |
| POST | /api/auth/RefreshToken | Refresh Token |
| POST | /api/auth/ChangePassword | Change the current user password |
| POST | /api/auth/Logout | Log out the current session |
| POST | /api/auth/LogoutAll | Delete all current user sessions |
| POST | /api/auth/Me | Get current user information |
| POST | /api/auth/GetMyMenus | Get the menu accessible by the current user |
| POST | /api/auth/GetUserPermissions | Get current user permissions |
| GET | /api/auth/GetRuntimeConfig | Get runtime configuration for login page |
External identity and single sign-on
| Method | Path | Purpose |
|---|---|---|
| POST | /api/identity/GetLoginOptions | Get permitted login entries for the current realm and purpose. |
| POST | /api/identity/Start, /api/identity/Complete | Start browser authorization and exchange a short-lived completion code in the original browser. |
| POST | /api/identity/GetMyAccounts | List the current user’s external accounts. |
| POST | /api/identity/Reauthenticate, /api/identity/UnlinkMyAccount | Confirm identity and unlink an external account. |
| POST | /api/identity/GetMySessions, /api/identity/RevokeMyOtherSessions | List sessions and revoke other-device sessions. |
| POST | /api/identity/LogoutProvider | Sign out of this application and a supported identity platform. |
| POST | /api/adminidentity/GetProviders, SaveProvider, CheckProvider, PublishProvider | List, save, check, and publish providers. |
| POST | /api/adminidentity/GetHostSettings, SaveHostSettings | Read and save the public site address. |
| POST | /api/adminidentity/GetPolicy, SavePolicy | Read and save login policy. |
External identity requires the same-origin browser, original flow state, and matching purpose. A completion code is not an access token. See Identity Authentication.
TGateway API reference
System monitoring
| Method | Path | Purpose |
|---|---|---|
| GET | /api/systemmonitorcontroller/getmemory, gethealth, getsnapshot | Process memory, health, and complete resource snapshots. |
| GET | /api/systemmonitorcontroller/getenvironment | Operating-system, runtime, and GC environment. |
| GET | /api/systemmonitorcontroller/getfrontendpackages, getbackendpackages | Current frontend and backend package lists. |
| POST | /api/systemmonitorcontroller/probenetwork | Check an upstream host and TCP port. |
| POST | /api/systemmonitorcontroller/collectgarbage | Submit an authorized manual GC request. |
Snapshots can reuse samples collected within 30 seconds. Monitoring, package lists, and manual GC check their respective permissions. GC does not guarantee an immediate working-set decrease. See System Monitoring for measurement scopes and operation steps.
Status and debug WebSocket connections
- Use the current Bearer token with
POST /api/gatewaywebsocketcontroller/createstatusticketorcreatedebugticketto request a status or read-only debug ticket. - Within 30 seconds, connect to
/ws/gateway/status?ticket=<ticket>or/ws/gateway/debug?ticket=<ticket>. Usewssfor HTTPS sites. - A ticket is consumed once and cannot be exchanged between purposes. Request another before reconnecting; do not reuse expired or consumed tickets or place long-lived access tokens in connection URLs.
Status tickets require variable-read permission; debug tickets require debug-query permission. A ticket does not grant write access.
TGateway Overview and Metadata
| Methods | Path | Purpose |
|---|---|---|
| GET | /api/gatewayoverviewcontroller/getgatewaytotal | Obtain channel, Equipment, variables, alarm statistics |
| GET | /api/gatewayoverviewcontroller/getcollectdevices | Get an overview of the collection device |
| GET | /api/gatewayoverviewcontroller/getchanneldevice | Get the channel and device summary by device |
| GET | /api/gatewayoverviewcontroller/getofflinedevices | Get the list of offline devices |
| POST | /api/gatewayoverviewcontroller/inserttestdata, inserttestdtudata | Generate demo data or DTU demo data |
| POST | /api/gatewayoverviewcontroller/getchannelstatuspagelist | Paginate channel status |
| POST | /api/gatewayoverviewcontroller/getdevicestatuspagelist | Paginate device status |
| POST | /api/gatewayoverviewcontroller/getvariablestatuspagelist | Retrieve variable status from page |
| GET | /api/gatewaysystemcontroller/getsysteminfo | Get system information such as CPU, memory, disk, and runtime |
| GET | /api/gatewayprojectcontroller/getprojectinfo | Get the current project information |
| GET | /api/gatewayplugincontroller/getplugincatalog?pluginType=Collect, ?pluginType=DataForward | Get the complete plugin catalog, optionally filtered by plugin type |
| GET | /api/gatewaymetadatacontroller/getchanneltypes?pluginName=<collection-plugin-full-name> | Gets the channel types supported by the collection plugin. The device editor uses this result to determine whether “Channel” is required. |
| GET | /api/gatewaymetadatacontroller/getchannelselectlist | Get the channel dropdown list |
| GET | /api/gatewaymetadatacontroller/getdeviceselectlist | Get the device dropdown list |
| GET | /api/gatewaymetadatacontroller/getvariableselectlist | Get the variable dropdown list |
| GET | /api/gatewaymetadatacontroller/getdatatypes,getdriverpropertyinfo, getaddressdescription | Get the data type of the collection plugin, Property Definition and Address Description |
| GET | /api/gatewaymetadatacontroller/getdataforwardtargetpropertyinfo, getdataforwardvariablepropertyinfo | Retrieve data forwarding target attributes and target variable attribute definitions |
Collect and configure interfaces
| Objects | Main paths | Purpose |
|---|---|---|
| Channel | /api/channelcontroller/addchannel, updatechannel, deletechannel, batcheditchannel, copychannel | Add, edit, delete, batch edit, copy |
| Channel import and export | /api/channelcontroller/channelexcelexport,channelpageexcelexport, channelexcelimport | channel Excel import/export |
| device | /api/devicecontroller/adddevice, updatedevice, deletedevice, batcheditdevice, copydevice | Add device, edit, delete, batch edit, copy |
| Device import and export | /api/devicecontroller/deviceexcelexport,devicepageexcelexport, deviceexcelimport | Device Excel import and export |
| variable | /api/variablecontroller/addvariable, updatevariable, deletevariable, batcheditvariable, copyvariable | Add, edit, delete, batch edit, copy variables |
| Variable import and export | /api/variablecontroller/variableexcelexport, variableexcelimport, gatewaydataexcelexport, gatewaydataexcelimport | Import and export variables and gateway configuration. |
| Write variable | /api/gatewaywritevariablecontroller/setvariablevalue | Write variable value |
Plugin method RPC
POST /api/gatewayrpccontroller/invokepluginmethod uses a Bearer Token and rpc:invoke_plugin_method API permission. Enable Allow method calls on the called device or target; no variable binding or additional method allowlist is required.
{"subjectType":"CollectDevice","subjectId":1001,"methodName":"ReadAsync","parameters":["400001","UInt16",1],"timeoutMs":30000}Replace 1001 with the actual instance ID; use DataForwardTarget for forwarding targets. There is no business request ID, deduplication cache, or method concurrency quota. Check data.status, isSuccess, operCode, message, content, executionTime, and executionMayHaveOccurred separately from HTTP success.
The dangerous-debug endpoint POST /api/debugController/invokespecialmethod uses parametersJson, a JSON text positional array, and returns contentJson as complete JSON text. The formal endpoint uses an actual parameters JSON value. Preserve number precision and do not mix these shapes. See Plugin Method Calls for MQTT, UA, timeouts, and logs.
Data forwarding interface
| method | path | purpose |
|---|---|---|
| GET | /api/gatewaydataforwardcontroller/getgroups | Get forwarding group |
| GET | /api/gatewaydataforwardcontroller/gettargets | Get forwarded targets |
| POST | /api/gatewaydataforwardcontroller/getgroupvariablespage | Get one forwarding group’s variable relations by page |
| GET | /api/gatewaydataforwardcontroller/getgroupvariable, getgroupvariableoptions | Get one group relation or remotely search variables in the group |
| POST | /api/gatewaydataforwardcontroller/gettargetvariablepropertiespage | Get one target’s variable properties by page |
| GET | /api/gatewaydataforwardcontroller/gettargetvariableproperty, getconfigurationcounts | Get one target variable property or navigation counts |
| GET | /api/gatewaydataforwardcontroller/getruntime | Get the data forwarding running status |
| POST | /api/gatewaydataforwardcontroller/addgroup, updategroup, deletegroup, restartgroup | forwardgroup maintenance |
| POST | /api/gatewaydataforwardcontroller/addtarget,updatetarget,deletetarget, restarttarget | forwarding target maintenance |
| POST | /api/gatewaydataforwardcontroller/switchtargetredundant | Manually switch the redundancy state of forwarded targets |
| POST | /api/gatewaydataforwardcontroller/savegroupvariablechanges | Incrementally save changed and deleted forwarding group variables |
| POST | /api/gatewaydataforwardcontroller/upserttargetvariableproperty, deletetargetvariableproperty | Save or delete target variable properties |
| POST | /api/gatewaydataforwardcontroller/getgrouplog, gettargetlog | query and forward runlog |
| POST | /api/gatewaydataforwardcontroller/updategrouploglevel, updatetargetloglevel | Adjust forwarding group or forwarding target log level |
| POST | /api/gatewaydataforwardcontroller/exportgrouplog, exporttargetlog | export and forwarding runlog |
| POST | /api/gatewaydataforwardcontroller/dataforwardexcelexport, dataforwardexcelimport | data forwarding configuration import and export |
In the data forwarding interface, forwarding group variable relations determine whether a variable belongs to a group, while target variable properties only describe how one target uses it. Group relations and target properties are paged by one group or target with a maximum page size of 200; remote group-variable searches return at most 50 candidates. In Manual scope, add the variable to the group through savegroupvariablechanges before saving target variable properties.
Data Query and Real-Time Alarm Interface
| Methods | Paths | Uses |
|---|---|---|
| POST | /api/gatewayrealdatacontroller/GetRealDataRecordsByTarget | Query real-time data records |
| GET | /api/gatewayrealdatacontroller/GetRealDataTargetNames | Get real-time data targets |
| POST | /api/gatewayrealdatacontroller/ExportRealDataRecords | Export real-time data records |
| POST | /api/gatewayhisdatacontroller/GetHisDataRecordsByTarget | Query historical data records |
| POST | /api/gatewayhisdatacontroller/GetHisNumberDataRecordsByTarget | Query historical numerical data |
| POST | /api/gatewayhisdatacontroller/GetTypedHisDataRecordsByTarget, GetTypedHisNumberDataRecordsByTarget | Sort and query typed history by UTC time range, variable set, pagination, and whitelist |
| POST | /api/gatewayhisdatacontroller/GetHisNumberSeriesByTarget | query Auto, Raw, Average, Minimum, Maximum, First, Last Historical numerical sequences in different modes |
| GET | /api/gatewayhisdatacontroller/GetHisDataTargetNames | Get historical data targets |
| POST | /api/gatewayhisdatacontroller/ExportHisDataRecords, ExportHisNumberDataRecords | Export historical strings or numeric data |
| POST | /api/customsqldatacontroller/GetCustomSqlDataByTarget | query custom SQL historical data |
| GET | /api/customsqldatacontroller/GetCustomSqlColumns | Get custom SQL columns |
| POST | /api/customsqldatacontroller/ExportCustomSqlData | Export custom SQL data |
| POST | /api/gatewayrealalarmcontroller/getrealalarmvariables | query real-time alarm |
| POST | /api/gatewayrealalarmcontroller/confirmalarm | Confirm real-time alarm |
| POST | /api/gatewayhisalarmcontroller/GetHisAlarmRecordsByTarget | Query historical alarms |
| GET | /api/gatewayhisalarmcontroller/GetHisAlarmTargetNames | Get historical alarm targets |
| POST | /api/gatewayhisalarmcontroller/ExportHisAlarmRecords | Export History Alarms |
Historical query contract
Historical paging endpoints use the following common request fields:
| Field | Description |
|---|---|
targetName | Name of a saved and queryable historical data-forwarding target. |
current | Page number, starting at 1. |
size | Page size; stay within the configured limit instead of requesting all history. |
sortField | Standard history uses property asc/desc, for example createTime desc; custom SQL wide tables must use an actual returned column, for example event_time desc. Clear the previous sort when changing targets. |
conditionalModel | Variable ID and time-range conditions for standard history; custom wide-table fields must exist in the target table. |
timeZoneId | Time zone used by export endpoints; the query page uses the target’s configured time zone. |
Standard history endpoints return wall-clock values projected to the target’s configured time zone. The typed endpoints GetTypedHisDataRecordsByTarget and GetTypedHisNumberDataRecordsByTarget use UTC time ranges and return UTC instants. Custom SQL endpoints return the target table’s raw columns and values: IoTDB and QuestDB wide-table timestamps may retain a Z suffix, which means UTC and must not be converted twice.
Custom SQL columns
Call /api/customsqldatacontroller/GetCustomSqlColumns?targetName=... and build the table and filters from the returned column set. The first column is the target time column used for time-range filtering and descending order; the remaining columns come from CustomTemplateConfig.Columns. Do not force standard CreateTime, VariableId, or Value fields onto a custom wide table.
Custom SQL queries still return paged records and total. total is the database count under the target, time range, and conditions, not records.length; clients must drive pagination from the server total.
Query limits
Typed history, numeric series, and export endpoints are protected by the variable-count, time-range, page-size, series-point, source-record, and export-row limits in Configuration/HisDataQueryOptions.json. Split wide ranges or use series aggregation instead of requesting millions of raw rows in one call.
Typed historical queries should use the UTC start and end times and are protected by variable count, time span, page size, sequence number of points, source record count, and export row limits. The default upper limit is maintained in Configuration/HisDataQueryOptions.json; The integrator should design requirements based on pagination and numerical sequence aggregation capabilities, and should not pull all original records at once over an extremely large time frame.
MQTT clients and MQTT server producers can call the same history capabilities through the default RpcHistory topic. The request topic is RpcHistory/<32-character-hex-request-id>, and the response topic is RpcHistory/<request-id>/Response. The protocol supports target queries, record queries, numeric sequences, historical alarms, alarm confirmation, and request cancellation. Large responses are compressed with gzip and split into Base64 blocks, subject to request body, response body, block size, concurrency, and timeout limits.
Device and forwarding target debugging interface
| Module | Main path | Purpose |
|---|---|---|
| Debug Objects | /api/debugController/getsubject, canhandle | Obtain debugging objects and capabilities for collection devices or forwarding targets |
| Basic Read and Write | /api/debugController/read,write,batchread, batchwrite | Foundation class device address read/write and batch read/write |
| TCP server | /api/debugController/gettcpclients, querytcpclients, kicktcpclient | Load action options, page through, or disconnect TCP server clients |
| OPC UA | /api/opcUaController/browse,readnode,writenode,subscribe,unsubscribe,getsubscriptions,readnodeattribute,exportvariables, importtodatabase | OPC UA nodes for browsing, reading, writing, subscription, and variable import and export |
| OPC DA | /api/opcDaController/browse, readnode, writenode, subscribe, unsubscribe, getsubscriptions, exportvariables, importtodatabase | OPC DA nodes browsing, read/write, subscribe, and variable import/export |
| MQTT Client | /api/mqttClientController/publish,subscribe,unsubscribe, getsubscriptions | MQTT client publishing, subscriptions, and subscription lists |
| MQTT Server | /api/mqttserverController/getclients,getstats,kickclient, publish | MQTT server client, Topic statistics, kicking out clients, and publishing tests |
| Kafka / RabbitMQ | /api/kafkaController/publish, /api/rabbitmqController/publish | Kafka Topic or RabbitMQ Routing Key Publishing Test |
| CAN / ZeroMQ | /api/canController/sendFrame, readFrame, /api/zeroMQController/publish | CAN frame send/receive and ZeroMQ publish testing. |
| IEC61850 Client | /api/iec61850Controller/GetLogicalDeviceList,GetDataDirectory,ReadValue,WriteValue,BrowseModel,GetConnectionStatus,GetLogicalNodeDirectory,GetReportSubscriptionStatus,GetGooseSubscriptionStatus,GetFileDirectoryPage,ReadJournalPage,ReadDataSet,GetDataSetDirectory,GetControlModel,ControlOperate | IEC61850 client model browsing, read/write, paged files and journals, report/GOOSE status, and controls |
| IEC61850 Server | /api/iec61850ServerController/GetLogicalDeviceList,GetDataModelTree,BrowseModel,GetConnectionCount,GetConnectedClientsPage,GetCatalogOptions,GetCatalogPage,ReadJournalPage,ReadAttributeValue,WriteAttributeValue,GetServerStatus,GetVariableMapStats,GetUnmappedVariablesPage | IEC61850 server model, paged clients/resources/journals/unmapped variables, and variable mapping diagnostics |
| IEC61850/IEC104 master SOE | /api/iec61850Controller/GetSoeEvents, ExportSoeEvents; /api/iec104MasterController/GetSoeEvents, ExportSoeEvents | Querying and exporting SOE events for the selected master instance |
Rules, scripts, node interfaces
| modules | main paths | Purpose |
|---|---|---|
| Rule flow | /api/gatewayruleenginecontroller/getruleflows, getruleflowspaged, getruleflowdetail, saveruleflow, validateruleflow, setruleflowenabled, deleteruleflow, deleteruleflows | Queries, draft validation, persistence, explicit enablement, and deletion |
| Rule runtime | /api/gatewayruleenginecontroller/getruleenginestatus, getflownodevalues, getallflownodevalues, getruleenginelog, exportruleenginelog | Loaded instances, node/connection observation, and logs |
| Rule packages | /api/gatewayruleenginecontroller/ruleflowpackageexport, importruleflowpackage | JSON packages; create, skip, or explicitly replace each imported flow |
| scripts | /api/gatewayscriptcontroller/getscriptlist,createscript,deletescripts,compilescript, compileallscripts | Paged script list, create, delete, compile |
| Script metadata | /api/gatewayscriptcontroller/getregisteredexpressionspaged,getexpressioncategories, getscriptcategories | Registered expressions, classifications |
| Custom nodes | /api/gatewaycustomnodecontroller/getlocalcustomnodes,getcustomnodespaged,createcustomnode,deletecustomnodes,compileallcustomnodes | Paged local and loaded node lists, create, delete, batch compile |
| Editor assistant | /api/completion/complete,codecheck,signaturehelp,hover,definition, formatcode | Script and node editor code hints, checking, and formatting |
DefinitionJson describes the executable graph with stable node type IDs and named ports; layout is separate. POST validateruleflow returns positioned diagnostics without saving or executing. Enabled flows must pass semantic validation.
POST setruleflowenabled takes id, enabled, and the current controlRevision. Save/control responses report runtimeReloaded and runtimeReloadError separately from configuration persistence. Reload and compare the current revision after a conflict.
Node observations distinguish current activity, last execution, explicit Skipped reasons, and idle waitingReason. Connection activity retains the last actual delivery result/time after later skips. See Runtime Observation.
Plugins, certificates, and system settings interfaces
| modules | main paths | Uses |
|---|---|---|
| Plugin | /api/gatewayplugincontroller/getplugincatalog, updatepluginenable, batchenableplugins, batchdisableplugins, syncpluginconfigs | Complete plugin catalog, enable/disable, synchronize |
| Certificates | /api/certificatecontroller/getcertificates, addcertificate, updatecertificate, deletecertificates, generatecertificateauthority, generateservercertificate, generateclientcertificate, exportcertificate, exportprivatecertificate, getcertificateselectlist | TAdmin certificate queries, uploads, updates, deletion, generation, export, and selection lists. |
| alarm configuration | /api/gatewayalarmconfigcontroller/GetAlarmConfig, UpdateAlarmConfig | alarm recovery policy |
| Redundancy | /api/gatewayredundantcontroller/getsitecollectstate,GetSiteDataForwardState,getredundancyoptions,setredundancyoptions, switchredundantstate | gateway collect/forwarding status, master-standby redundancy configuration, and state switching |
| Network | /api/gatewaynetworkconfigcontroller/getnetworkconfigs, setnetworkconfig | network card configuration query and settings |
| time synchronization | /api/gatewaytimecontroller/getsystemtime,setsystemtime,getntpconfig,setntpconfig, syncntptime | system time and NTP configuration |
| system control | /api/gatewayrestartcontroller/restartgateway,restartruntime, restartapplication | Restart gateway, runtime, or application |
| Backup | /api/backupcontroller/backupconfigdatabase | Backup configuration database |
| PING | /api/gatewaypingcontroller/pingtest | Network connectivity testing |
Certificate interface upgrade
Certificate management has been migrated to the TAdmin unified module. Old /api/gatewaycertificatecontroller/... The controller is no longer the current interface; The caller must switch to /api/certificatecontroller/..., synchronously adjusting the action names such as generatecertificateauthority, deletecertificates, and certificate:* permission code.
Log Interface
| Log Type | Main Path |
|---|---|
| Backend Log | /api/backendlogcontroller/getbackendlog,getbackendlogsources,getallbackendlog,exportbackendlog, exportallbackendlog |
| Channel Log | /api/channelcontroller/getchannellog,updatechannelloglevel, exportchannellog |
| device log | /api/devicecontroller/getdevicelog,updatedeviceloglevel, exportdevicelog |
| Operation Logs | /api/adminsystemlogcontroller/getoperatelog, /api/adminsystemlogcontroller/exportoperatelog |
| RPC logs | /api/rpclogcontroller/getrpclog, exportrpclog |
| SQL Logs | /api/adminsystemlogcontroller/getsqllog, /api/adminsystemlogcontroller/exportsqllog |
| audit logs | /api/adminauditlogcontroller/getloginaudit,getpermissionaudit, getusersecurityaudit and corresponding export interfaces |
Management permissions interface
| Object | Main path | Purpose |
|---|---|---|
| User | /api/gatewayusercontroller/getusers,adduser, updateuser, setroles, resetpassword, lock, unlock, deleteuser | User Lifecycle and Role Allocation |
| Sessions | /api/gatewayusercontroller/getusersessions,revokesession, setsessionrevoked | User Session Management |
| Role | /api/gatewayrolecontroller/getroles, addrole, updaterole, copyrole, setpermissions, previewpermissiondiff, getpermissioncatalog, getallapimethods, getallbuttons, getrolebyid, deleterole | Role and permission maintenance |
| Menu | /api/gatewaymenucontroller/getmenutree,savemenu,validatemenu,movemenu,setmenuenabled,setmenuvisible, deletemenu | Menu tree maintenance |
| button | /api/gatewaybuttoncontroller/getbuttons, getbuttonsbymenuid, getallbuttons, addbutton, updatebutton, deletebutton | Button permission maintenance |
Studio and Watchdog interface
Studio authentication
| methods | Path | Description |
|---|---|---|
GET | /api/auth/GetLoginPasswordPublicKey | Get a temporary public key for encrypting the login password. It expires after two minutes and can be used once. |
POST | /api/auth/Login | using name,passwordKeyId, password Base64 ciphertext password login. |
POST | /api/auth/ChangePassword | Use Studio JWT Bearer to change the current password and return the reissued JWT. |
Sign in to a new Studio installation with admin / 111111. Studio creates the default account when its account configuration is missing. Successful login returns a JWT Bearer valid for seven days. Change the password from the user menu.
Watchdog Authentication
| Method | Path | Description |
|---|---|---|
GET | /api/watchdog/login/password-public-key | Get a temporary public key for encrypting the password. It expires after two minutes and can be used once. |
POST | /api/watchdog/login | to use username,passwordKeyId, password Base64 ciphertext password login. |
POST | /api/watchdog/logout | Undo the current Bearer session. |
Watchdog supports direct login with the default admin / 111111 account, or the valid credentials already configured. After login, it returns accessToken, username, and expiresAt. The random opaque token is valid for eight hours; the server keeps only its SHA-256 digest in memory. Logout or a Watchdog restart invalidates it.
| Application | Main Paths | Purpose: |
|---|---|---|
| Studio Authentication | /api/auth/GetLoginPasswordPublicKey, Login, ChangePassword | Studio login password encryption, login, and password change |
| Studio language service | /api/completion/assemblies, complete, codecheck, signaturehelp, hover | Reference checks, completion, diagnostics, signatures, and documentation; see Code Editor. |
| Studio projects | /api/project/list, create, update, import | List, create, edit, and import projects. |
| Studio runtime | /api/runtime/current-project, start, stop, gateway-version, app-version | Local runtime status and versions |
| Studio Watchdog | /api/watchdog/configs,config/save, :upload, download | Watchdog connection, upload, download |
| Studio tunnel | /api/tunnel/status,listeners,config,start, stop | tunnel proxy status and configuration |
| Watchdog authentication | /api/watchdog/login/password-public-key, login, logout | Watchdog password encryption, login, and logout |
| Watchdog status | /api/watchdog/status,projects,logs, backups | dashboard, project, logs, backup |
| Watchdog project | /api/watchdog/project/upload, project/download/{name}, apply/{name}, project/{name} | project upload, download, apply, delete, |
| Watchdog process | /api/watchdog/restart, stop | Restart or stop the gateway while running |
| Watchdog backup | /api/watchdog/backup/create, backup/restore/{name}, backup/{name} | create, restore, delete backups |
| Watchdog tunnel | /api/watchdog/tunnel/status, activate/{name}, deactivate/{name}, activate-all, deactivate-all | tunnel client status and start/stop |
| Watchdog settings | /api/watchdog/options, change-password | Watchdog Configuration and Password Change |
Request troubleshooting
| Observation | Decision and next action | Recovery check |
|---|---|---|
| HTTP 401 or expired token | Check that the token belongs to this component and service, then sign in again. Restarting Watchdog invalidates its sessions | Repeat the same protected read-only request with the new token |
| HTTP 403 or permission denied | Check the account’s API permissions and, for Studio / Watchdog, remote-management and deployment settings | Repeat the original action with the same account |
| HTTP 400 or validation error | Read the complete message and compare method, required fields and types with this instance’s OpenAPI. Use the specified form for files | Verify a minimal valid request before adding filters or batches |
| HTTP 200 with HTML, or browser CORS error | Check whether the proxy routes API requests to the frontend fallback. Inspect headers and OPTIONS using CORS checks | Confirm that the actual calling page receives the expected JSON |
| A write fails or no device value changes | Check source-variable permissions, write conversion, plugin result and device state. Direct method calls also require their enable switch | Read back an approved test point from the physical device and inspect RPC logs |
Keep the request time, endpoint, status and redacted error message. Do not log login ciphertext, tokens, passwords or full production payloads. After a failed import or batch mutation, query the actual saved scope before retrying.
Usage Note
- Interface Paths Call according to the case and path in the table.
- Import/export, upload, and download interfaces may return files or receive form files; please call them in the request format in the interface documentation.
- Management interfaces are restricted by menu, button, and API permissions; If the role authorization is insufficient, even if the token is valid, it may return as no permission.