Rest API (PUT)

0
Hello All,   i am trying to call REST API (PUT) in mendix where i need to pass body parameter. when i tried to run it through POSTMAN, i am getting desired output but from mendix i am not sure what should be the request template format. I tried with multiple formats but i am getting runtime error.  POSTMAN request – Raw-  {   "values":{     "Status":"Cancelled",    "StatusUpdatedSource":"User" }}   I tried with mendix request format-  {{   "values":     "Status":"Cancelled",    "StatusUpdatedSource":"User" }   Runtime Error – Cannot construct instance of `java.util.LinkedHashMap` (although at least one Creator exists): no String-argument constructor/factory method to deserialize from String value ('Status').   Tried with some few format as well but no luck: {{     "Status":"Cancelled",    "StatusUpdatedSource":"User" }   {{   "values":[     "Status":"Cancelled",    "StatusUpdatedSource":"User"] } Please help me with the mendix format from which i can send request parameter.   Thanks..  
asked
2 answers
0

Values must be an entity with Status and StatusUpdatedSource attributes.

Have an export mapping for Values entity. I normally prefer to work with MD. But you can choose JSON structure too. 

In the Export mapping, you already have an option to work with List or single object.

Pass Values entity to the export mapping and you get the JSON back.

answered
0

This should work:

{{

    "values": {{

        "Status": "Cancelled",

        "StatusUpdatedSource": "User"

    }

}

 

answered