Jsonrpc request giving error for parameter 'th'

could someone please help me understand what is the th parameter in json rpc and what should be the value for it?
when I execute http://localhost:30742/jsonrpc with below payload

{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "query",
    "params": {
        "path": "/data_container:data"
    }
} 

it gives

{
    "jsonrpc": "2.0",
    "error": {
        "type": "rpc.method.missing_params",
        "code": -32000,
        message": "Missing parameters",
        "data": {
            "param": "th"
        },
        "internal": "webui_util249"
    },
    "id": 1
}. 

when I add the th parameter with below payload it says Invalid parameters.
Request

{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "query",
    "params": {
        "th": 33742,
        "path": "/data_container:data"
    }
}

Response:

{
    "jsonrpc": "2.0",
    "error": {
        "type": "rpc.method.invalid_params",
        "code": -32602,
        "message": "Invalid parameters",
        "data": {
           "param": "th"
       },
        "internal": "webui_util680"
    },
    "id": 1
}

As the old saying goes - when everything else fails, try reading the manual… :wink:
You don’t mention what previous steps you take when issuing the request so i assume you may have missed a mandatory step… Please check ConfD user guide and corresponding section for JSON-RPC - “Common concepts”, quoting:

The th param is a transaction handle identifier as returned from a call to new_read_trans or new_write_trans.

edit: i wanted to be “funny”, but it seems that some versions of ConfD guides may have error, and there’s a “new_trans” method with read/write parameter rather than standalole new_read_trans/new_write_trans methods… sorry for that :slight_smile:

1 Like

thanks @josephm . I am able to proceed now.