Insert RSD Paramaters to API Profile
Use RSD parameters in an API profile to create generic RSDs that can be distributed and reused by different clients or environments. Instead of creating multiple RSD files with hard‑coded values, you can insert parameters so the values can be updated through variables or filters in DataSync.
This approach saves time, reduces maintenance, and ensures flexibility — especially when the same RSD structure is used across multiple customers or deployments.
RSD parameters can have default values defined in the RSD file. If a required parameter has no default value, DataSync will display an error message in the extraction Filter column prompting you to provide one. The person creating the RSD controls which parameters have default values and which do not.
Be careful when pre‑populating RSD parameters before sharing the file. If the recipient does not need certain parameters but keeps the default values, they may connect to another client's data unintentionally.
Process overview
| Step | Description |
|---|---|
| Prepare RSD file | Create or edit the RSD XML to declare parameters, add validation rules, and reference them in the API URI. |
| Modify paramaters | Define validation rules, configure server-side checks for missing parameters, and use parameters in the request URL. |
| Detect missing parameters | Identify missing mandatory parameters in the extraction Tables screen — error and icon appear in the Filter column. |
| Provide paramaters | Use the SQL Expression Builder in the Filter column to add hard‑coded values or variable references. |
| Confirm application | Ensure icons and error messages disappear, fields are editable, and API calls use the supplied values. |
Configure the RSD file
Prepare the RSD file
Create or update your .RSD file to include parameters. The example below defines a CompanyId parameter, includes validations, and uses it in the API request URI.
<api:script xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:api="http://apiscript.com/ns?v1" >
<api:info title="CompanyStatus" desc="Returns the status of a company specified by its CompanyId." >
<attr name="CompanyId" xs:type="string" readonly="true" other:pseudocolumn="true" />
<attr name="Id" xs:type="string" readonly="true" other:xPath="id" key="true" />
<attr name="Title" xs:type="string" readonly="true" other:xPath="title" />
<attr name="Column1" xs:type="string" readonly="true" other:xPath="column1" />
<attr name="Column2" xs:type="string" readonly="true" other:xPath="column2" />
</api:info>
<!-- Setting global parameters -->
<api:set attr="ContentType" value="application/json" />
<api:validate attr="_input.CompanyId" desc="You must specify a CompanyId." />
<!-- Set authorization parameters -->
<!-- Using OAuth -->
<api:set attr="OAuthVersion" value="2.0" />
<api:validate attr="_connection.OAuthClientId" desc="OAuthClientId connection property should be specified for OAuth Authentication" />
<api:validate attr="_connection.OAuthClientSecret" desc="OAuthClientSecret connection property should be specified for OAuth Authentication" />
<api:validate attr="_connection.CallbackUrl" desc="CallbackUrl connection property should be specified for OAuth Authentication" />
<api:script method="GET" >
<api:set attr="method" value="GET" />
<api:validate attr="_connection.Deployment" desc="To query this table User is required to be specified in the connection string." />
<api:null attr="CompanyId">
<api:set attr="ColumnRequired" value="CompanyId" />
<api:push op="apisadoThrowColumnRequiredException" />
</api:null>
<api:set attr="uri" value="https://sample.url.value/[_input.companyIds]" />
<api:set attr="RepeatElement" value="/response" />
<api:call op="apisadoExecuteJSONGet">
<api:push/>
</api:call>
</api:script>
</api:script>
Modify parameters in RSD
-
Set validation for a parameter — This defines the required input and the error message if it's missing:
<api:validate attr="_input.CompanyId" desc="You must specify a CompanyId." /> -
Configure back‑end detection — This ensures the RSD throws an error if the parameter is missing when executed:
<api:null attr="CompanyId"><api:set attr="ColumnRequired" value="CompanyId" /><api:push op="apisadoThrowColumnRequiredException" /></api:null> -
Use the parameter in the URL:
[_input.companyIds]