Version 3.0 REST API updating relations

In the version 3.0 of the API we could remove and add relationships in the same API call.
Below are the parameters we used to remove and add objects in the same call. The items we wanted to delete were obviously in the meta and the items we wanted to add were in the followedRetailersArray.
Is there a way to do this in the 4.0 API? It looks like you have a method which allows us to overwrite the data called set relation and a separate method to add called add relation and another one for deleting called Delete. Do you have a call that combines the add and delete but does not overwrite the existing relationships? We would rather make one call opposed to 2 and we would rather not overwrite the data if we don’t have to.

let followedRetailersArray = OURVALUES1 //[[String:String]]
let removedRetailers = OURVALUES2 //String

parameters = [ 
"followedRetailers": followedRetailersArray,
"__meta": "{\"relationRemovalIds\":{},\"selectedProperties\":[],\"relatedObjects\":{\"followedRetailers\":\(removedRetailers)}}" 

With version 4 you get dedicated methods to add/remove relations. However, there is no single call which would both add and remove related objects.


Thanks for the quick reply! Is this something that you might consider changing? Is there a reason you had this in 3.0 but do not have it in 4.0?

No, this will not be changing in 4.0. Multiple operations on an object hierarchy in the context of a single transaction (request) are error prone in an environment with high number of transactions. This leads to a number of problems and generally slows down the server.

Perfect. Thanks a lot!