We have implemented a rest service within a managed package. A few of our customers have already installed this package. Currently it takes 3 parameters. The purpose is to send updates made in one system to a Salesforce instance with the managed package installed. In building this service we followed the examples outlined here…..
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_rest_methods.htm
We want to add an optional parameter to our POST method call. Go from 3 parameters to 4 for example. We want this change to be backward compatible. What we see in trying to test this is a “Resource Not Found” error when sending 4 parameters rather than the old 3 parameters.
Is it possible to just update the rest service code without having all our customers install the package again? Or Does anyone who has installed the managed package have to go out and get a new package in order to read the new parameter? What is the best way to manage changes or updates like this?
Is there a better implementation or way to deal with this kind of scenario? Is it the responsibility of the invoker to determine the API/package version installed and pass in three or four parameters?
If you can share the best practice around upgrading REST API method implementation within salesforce it is really appreciated.
Example Old Way: ../apex/updateSomething sent with json in body {"Element1":"Value1","Element2":"Value2","Element3":"Value3"}
Example New Way: ../apex/updateSomething sent with json in body {"Element1":"Value1","Element2":"Value2","Element3":"Value3","Element4":"Value4"}