Can't seem to POST z_getoperation status

I’m trying to get data through POST z_getoperationstatus.

My method is this:
{"method":"z_getoperationresult","params":["opid-5e7e06b1-931d-40b7-833a-f3ade98f418d"]}

But I get this error message and I have no idea how to solve it:

{ result: null,
  error: { code: -1, message: 'JSON value is not an array as expected' },
  id: null }

Can anyone tell me what I’m doing wrong?

Check out the example zcash-cli help z_getoperationstatus which returns as an example:

Examples:
zcash-cli z_getoperationstatus ‘[“operationid”, … ]’
curl --user myusername --data-binary ‘{“jsonrpc”: “1.0”, “id”:“curltest”, “method”: “z_getoperationstatus”, “params”: [’[“operationid”, … ]’] }’ -H ‘content-type: text/plain;’ http://127.0.0.1:8232/

So as per the error message looks like you need an extra array in there.

Yep, there are two arrays involved here:

  • JSON-RPC positional arguments are represented as an array.
  • z_getoperationstatus takes an array of operation IDs as its first positional argument.

Looks a bit funky when there’s only one argument, but oh well.

1 Like