AnsweredAssumed Answered

custome response for out-of-the-box sugar API WS

Question asked by Daniel Alexander Montoya Herrera on Feb 11, 2020
Latest reply on Feb 13, 2020 by André Lopes

We are sugar partners and we have a large implementation of sugarcrm in terms of customization.

 

They will be using sugar flower "serve + sell" that is ondemand deployment option only for now.

 

The thing is that user is no conform with the way sugar api WS response, specially delete and put, since the stock response doesn't tell them if the operation did works of not, like if there was a DB or php error.

 

 

For example, when you perform a DELETE request of a record, sugar just return the same id of the records that you request to remove, that it doesn't tell if it did works at 100%, the only way to be sure if to try to GET the same record again.

 

 

Another example is for PUT, when you request update a record with the sugar api, the WS stock response just return you the hole module/record entity with all fields on it instead of just the ones you did update on your request JSON body you could try to check one by one if the value send is the same sent/received what is not ideal.

 

 

There is  a way to customize the stock response of sugar stock response to add some "status" key to the JSON and tell the client if it did works as expected or just fail it?

 

Please let me know what do you think about this and if there is a way to accomplish this.

Outcomes