You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

REST API: how to overwrite instead of add to a namedIdHierarchy object on PATCH

Received Response
21
Views
2
Comments
edited Sep 10, 2018 2:10PM in Integrations and APIs 2 comments

Content

I'm trying to update the product and category in an answer record but I need the new value(s) to REPLACE the existing values and not add them as additional product/category which are namedIdHierarchy objects. Below is a sample JSON I pass to a PATCH http request:

{
"products" : [{
          "id" : 117
    },
    {
        "id" : 123
    }
],
"categories" : [{
      "id" : 154
    },
     {
     "id" : 160
     }
]
}

I tried nulling them out first and then send another request with the new values but this will impact performance as this will now require 2 separate requests.

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!