[SalesForce] Need to enforce data integrity using REST API

We are consuming a REST API which created an insert on Lead object. We want to enforce data integrity from the external application to salesforce so that any field level changes on the external application throws a compile error in the salesforce side. I know this can be done easily with SOAP but the question is how can we enforce a data contract between Salesforce and external application using REST API?
Can we create a JSON object structure on the legacy application which would be referenced as an object in the salesforce side and data sent as a JSON Post? The goal is to enforce field level changes on both applications consistently instead of loose coupling which REST provides? Any thoughts?
Buyan

Best Answer

Not sure exactly what you are planning, but any validation that you implement in Force.com, e.g. in a Validation Rule or Trigger, is enforced on all access, whether in the browser or via the SOAP or REST APIs.

Related Topic