giip

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:

  1. Call
    GetOpenclawSync
    to verify hashes and receive updated data.
  2. Call
    PutOpenclawSync
    to upload local changes to the GIIP server.

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

FieldTypeRequiredDescription
at
StringYAgent Token (for authentication)
lssn
IntegerYLocal Server Identifier
configHash
StringNCurrent local config hash
docHash
StringNCurrent 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

FieldTypeRequiredDescription
at
StringYAgent Token
lssn
IntegerYLocal Server Identifier
changedConfigs
ObjectNChanged config items (Key-Value)
changedDocs
ArrayNChanged documents (with
doc_path
and
doc_content
)

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
    at
    token is invalid. Please verify or reissue the token.
  • RstVal: 400 (Invalid Parameter): Missing required parameters (
    at
    ,
    lssn
    ). Check the JSON request format.
  • RstVal: 500 (Internal Server Error): Database communication or SP execution error. Check
    tErrorLogs
    for precise root cause analysis.