Understand API Profile Structure
An API profile defines the schema that DataSync uses to retrieve and organize your API data. This page explains the structure of API profiles (.rsd files), describes the purpose of each key element, and guides you in customizing profiles to fit your specific requirements.
Before you begin, make sure you have file archive software (such as WinZip, 7-Zip, or WinRAR) installed. These tools let you extract and edit tables stored in .apip API profile files.
Tables (.rsd files) are schema files included in API profile files (.apip extension, treated as .zip by the system). .rsd files are used to define input parameters for endpoint management and row/column display in DataSync.
Install Postman to help you visualize your API structure and understand attribute nesting.
Configure Postman for large API data
- Open Postman.
- In the upper right, click the settings (wrench) icon and select Settings.
- Under the General tab, set Max response size in MB to
0. - Close the dialog to save your changes.
Understand the .rsd file structure
Before you customize or create an API profile, understand the structure of the .rsd (schema) file.
<api:script>
<api:info>
<attr/>
</api:info>
<api:set attr="ContentType" value="application/json" />
<api:script method="GET" >
<api:set attr="method" />
<api:set attr="uri" />
<api:set attr="RepeatElement" />
<api:set/>
<api:call>
<api:push/>
</api:call>
</api:script>
</api:script>
Key components of an .rsd file
An .rsd file is an XML schema file that defines your custom API profile. The main elements and their purposes are described below.
Script structure and metadata
The API profile is enclosed in the <api:script> element, which defines the script metadata and XML namespaces:
<api:script xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:api="http://apiscript.com/ns?v1" >
Defining tables and columns
The <api:info> element sets the table name and description using the title and desc attributes. It also specifies the table columns using one or more <attr> elements.
<api:info xmlns:other="http://apiscript.com/ns?v1" title="Countries" desc="A List of Countries">
<attr name="name" xs:type="string" readonly="true" other:xPath="name.common"/>
<attr name="status" xs:type="string" readonly="true" other:xPath="status"/>
<attr name="area" xs:type="integer" readonly="true" other:xPath="area"/>
</api:info>
Common xs:type values
| Value | Description |
|---|---|
string | Text values (characters, line feeds, spacing) |
decimal | Decimal numbers (e.g., 9.12) |
integer | Whole numbers (e.g., 9) |
date | Date in YYYY:MM:DD format |
time | Time in hh:mm:ss format |
datetime | Date/time in YYYY-MM-DDThh:mm:ss format |
Setting global parameters
The <api:set> element defines script-wide parameters. For example, you set the content type so the connector knows to expect JSON responses. To identify how data records are grouped in the API response, define the RepeatElement attribute. Use / for records at the root level, or specify an element name for nested records. See Advanced API profiles for more details on nesting.
<api:set attr="ContentType" value="application/json" />
<api:set attr="RepeatElement" value="/" />
Specifying API methods
Within the main script, add a nested <api:script method="..."> element to indicate the HTTP method the connector should use, such as GET, POST, PUT, PATCH, MERGE, or DELETE. The method attribute in <api:set> must match, and uri sets the API endpoint that DataSync calls to extract data.
<api:script method="GET">
<api:set attr="method" value="GET" />
<api:set attr="uri" value="https://restcountries.com/v3.1/all" />
...
</api:script>
Calling and outputting data
The <api:call> element specifies the operation to run against the API, and the <api:push> element tells DataSync to process and retrieve the results.
<api:call op="apisadoExecuteJSONGet">
<api:push/>
</api:call>