Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot invoke createThing Via REST #43

Open
dconroy opened this issue Apr 5, 2017 · 2 comments
Open

Cannot invoke createThing Via REST #43

dconroy opened this issue Apr 5, 2017 · 2 comments

Comments

@dconroy
Copy link
Contributor

dconroy commented Apr 5, 2017

After enrolling a user in the rest API:
Post:http://localhost:7050/registrar
{"enrollId":"test_user0","enrollSecret" :"MS9qrN8hFjlE"}
Response:
{ "OK": "Login successful for user 'test_user0'."}
I am then unable to create a new thing via invoke/rest
POST:http://localhost:7050/chaincode

{
   "jsonrpc":"2.0",
   "method":"invoke",
   "params":{
      "type":1,
      "chaincodeID":{
         "name":"a2abd8f6ca44ea7287003028698edcf723f27f248bd12c8c5f31d5d26a8dd94b"
      },
      "ctorMsg":{
         "function":"createThing",
         "args":[
            {
               "thingID":"6a0a2ac8-e34b-e111-a1e3-00155d690d2a",
               "userID":"084003277",
               "description":"State  Committee",
               "someProperty":"124914266456"
            }
         ]
      },
      "secureContext":"test_user0"
   },
   "id":0
}

Response:

{
  "jsonrpc": "2.0",
  "error": {
    "code": -32700,
    "message": "Parse error",
    "data": "Error unmarshalling chaincode request payload: json: cannot unmarshal object into Go value of type string"
  },
  "id": null
}


@dconroy
Copy link
Contributor Author

dconroy commented Apr 5, 2017

FYI i did add an extra field called description to the thing entity but that shouldnt be related to this error. Same issue with adding users as well.

@rbecsi-andigital
Copy link

Hi @dconroy
Can you please send the relevant Go chaincode for reference.
Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants