When creating or editing a REST model file, the parameter values you define in an endpoint might not apply to all users of the service. For example, using a parameter that filters results by your user ID or project might retrieve data relevant only to you. To facilitate sharing REST model files, the Composer allows you to designate parameter values in an endpoint as variables. Users with whom you share the file can then provide values for these variables that are replaced across their REST model file, allowing them to quickly customize the endpoints according to their use cases.

Replacing a parameter value with a variable

Before sharing a REST model file, you can replace parameter values that are user specific with variables. To replace a parameter variable with a variable in an endpoint:
  1. Select the Configure Endpoints tab from the menu.
  2. From the list of endpoints, expose and select the table that uses the parameter value you want to replace.
  3. In the Endpoints field or Parametrized Paths pane, double-click on the parameter value in the path that you want to replace with a variable. The Set as a new parameter window opens.
    Figure 1. Set as new parameter window in the Autonomous REST Composer
    Set as new parameter window in the Autonomous REST Composer
  4. In the Name field, type the name of the variable that will replace your parameter value.
  5. If the parameter value must be specified to return results, select the Mandatory check box. The mandatory box requires that a value is set for the parameter for the driver to query the associated table.
  6. Click Save to apply your changes.

After you done configuring your REST model file, you can click Download to generate a copy of the REST Model file to share.

Setting parameter values for variables

After opening a shared REST model file in the Composer, you need to replace the variables with parameter values before querying data. To replace a parameter variable with a variable in an endpoint:
  1. Select the Configure Endpoints tab from the menu.
  2. From the list of endpoints, expose and select the table that uses a parameter value you want to define.
  3. Open the Params pane to expose a list of parameters and value pairs that apply to the selected table. Note that a value must be specified for mandatory values.
  4. In the Value field, provide
  5. Click Set to apply your changes.

Follow this procedure for any table that uses parameter variables.