Custom field throws "Invalid extra-params, expecting object" error

0 votes
Hi,

This is the request I am sending to the server:

{"method":"issue","id":"930d2b32-f91e-4186-99ce-aaff26198e4a","jsonrpc":"2.0","params":["1DJN4RMhobxxxxmmmkkkjjj12feg2Un3XiHFgW","asset5np",222.0,0.5,0,"{\"custom-field-1\":\"Hallo World!\"}"]}

I keep getting: "Invalid extra-params, expecting object"

{
  "result" : null,
  "id" : "930d2b32-f91e-4186-99ce-aaff26198e4a",
  "error" : {
    "code" : -8,
    "message" : "Invalid extra-params, expecting object"
  }
}

I know the problem is with custom field, most likely its format, since if I omit it, it works fine.

Can you help, what type of Java object is it expecting> Can you give a sample custom field value?
asked Feb 9, 2016 by Nenad

1 Answer

0 votes

If you're sending a JSON-RPC request directly, you need to format the custom field in JSON-RPC format, rather than as a command-line parameter. It will be something like this:

{"method":"issue","id":"930d2b32-f91e-4186-99ce-aaff26198e4a","jsonrpc":"2.0","params":["1DJN4RMhobxxxxmmmkkkjjj12feg2Un3XiHFgW","asset5np",222.0,0.5,0,{"custom-field-1":"Hallo World!"}]}

answered Feb 9, 2016 by MultiChain
...