Reputation: 453
In IBM App Connect Enterprise REST API project, how can I pass path a parameter to a REST Request Node?
I can set a query parameter in a compute node using ESQL like
SET InputLocalEnvironment.Destination.REST.Request.Parameters.id = 'abc'.
The API works without an issue. But If I do the same thing for a path parameter the values are not getting passed. As a work around I set the value to an Environment variable in a compute node and get it via XPATH in the Rest Request Node properties.
Is there a similar way to set the path parameter in ESQL just like the query parameter?
Thanks in advance.
Upvotes: 1
Views: 3094
Reputation: 3041
So a bit surprised that InputLocalEnvironment is working for you.
For a RESTRequest node the URL is built up from BaseURL and Operation values, the Parameters option you've already found. The code below illustrates some of the values outlined in Environment Variables with Rest Nodes that can be used to override the behaviour of REST nodes. The link also describes values that are set after a REST Node has done its thing.
SET OutputLocalEnvironment.Destination.REST.Request.BaseURL = 'https://my-prod-server.ibm.com/customerdb/v1';
SET OutputLocalEnvironment.Destination.REST.Request.Operation = 'updateCustomerByID';
SET OutputLocalEnvironment.Destination.REST.Request.Parameters.max = 10;
SET OutputLocalEnvironment.Destination.REST.Request.Parameters.filter = 'Fred Bloggs';
Remember to configure the Compute Node to have a Compute Mode of LocalEnvironment And Message otherwise your settings are not going to be passed on to the subsequent RESTRequest node.
Upvotes: 1