Openclaw Synchronization API (Openclaw Sync API)
Overview
The Openclaw Sync API provides endpoints for two-way synchronization of data (configurations and documents) between a local Openclaw instance and the GIIP platform. Local agents like
giipAgentWin call this API periodically to pull the latest configurations or report local changes back to the central server.
Quick Start
To use this API, you need an Agent Token (
at) and a Local Server Identifier (lssn). The synchronization process is generally two steps:
- Call
to verify hashes and receive updated data.GetOpenclawSync - Call
to upload local changes to the GIIP server.PutOpenclawSync
Details and API Reference
1. Retrieve Sync Data (GetOpenclawSync)
Passes the local instance hashes to compare with the server. Returns the latest data if there is a mismatch.
- URL:
https://api.netbako.com/api/GetOpenclawSync - Method:
POST - Content-Type:
application/json
Request Parameters
| Field | Type | Required | Description |
|---|---|---|---|
| String | Y | Agent Token (for authentication) |
| Integer | Y | Local Server Identifier |
| String | N | Current local config hash |
| String | N | Current local document hash |
Response Format
If an update is required, it returns the new hashes and data.
{ "RstVal": 1, "RstMsg": "Update required", "Data": { "newConfigHash": "...", "newDocHash": "...", "configData": { ... }, "docData": [ { "doc_path": "...", "doc_content": "..." } ] } }
If there are no changes, it returns HTTP 200 with
RstVal: 304.
2. Upload Sync Data (PutOpenclawSync)
Uploads changed configurations or documents from the local instance to the GIIP server.
- URL:
https://api.netbako.com/api/PutOpenclawSync - Method:
PUT - Content-Type:
application/json
Request Parameters
| Field | Type | Required | Description |
|---|---|---|---|
| String | Y | Agent Token |
| Integer | Y | Local Server Identifier |
| Object | N | Changed config items (Key-Value) |
| Array | N | Changed documents (with and ) |
Response Format
Returns newly calculated hashes upon successful update.
{ "RstVal": 1, "RstMsg": "Successfully updated", "Data": { "newConfigHash": "...", "newDocHash": "..." } }
Troubleshooting
Common issues during API calls and how to resolve them.
- RstVal: -1 (Unauthorized): The
token is invalid. Please verify or reissue the token.at - RstVal: 400 (Invalid Parameter): Missing required parameters (
,at
). Check the JSON request format.lssn - RstVal: 500 (Internal Server Error): Database communication or SP execution error. Check
for precise root cause analysis.tErrorLogs