I’m trying to virtualize the Google Places Autocomplete rest service on our Mediators (9.9) using Centrasite (9.9). No problem there, but I’d like to fill certain query parameters in the GET method with default values, so the (internal) consumers of the virtual rest service do not have to know (for instance) the access token for the Google api.
I created a rest service with a resource called autocomplete. I added a path parameter so the client has the choice between xml and json output.
I created a method GET with all the required and optional parameters. If the consumer fills out the required parameters, everything works. But, like I said, I don’t want them (to have) to know the token. So I entered the token as a default value for the parameter ‘key’ in the GET method. I thought that when the consumer omitted the required parameter ‘key’, it would be added and filled with the default value by the Mediator (automagically). No way. If the consumer does not specify the parameter ‘key’ with the right value, Google responds with REQUEST_DENIED.
The question is… How do I solve this? How do I define the rest service/resource/method to have the parameter ‘key’ added to the list of parameters filled with a value defined in Centrasite or the Mediator?
Thanks in advance,