Quantcast
Channel: Discussion Forum > Connect Data Services
Viewing all articles
Browse latest Browse all 2504

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

$
0
0

Topic by Joel Sunaz

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.


Viewing all articles
Browse latest Browse all 2504

Trending Articles