API Data Provider - Online Help

CreateReportSchema

Generates a schema file that defines the structure of API responses, mapping fields and data types for integration with REST services.

CreateReportSchema

CreateReportSchema creates a schema file based on the specified report. This schema adds a table to your existing list that corresponds with the results of your report, which can then be queried like other tables. (Reports from the API are not modeled by provider as queryable tables by default.)

The generated schema file outlines the metadata for the report, such as columns and column data types. You can edit the file to adjust data types, rename columns, and include or exclude columns.

Updating a Report Schema

In the following example, the SP CreateReportSchema creates a new report using TestReportTest1 as a base template. It appends new columns to TestReportTest1 and creates a new report, named TestReport2. The new report is saved as ...\\TestReportTest2.rsd.
EXECUTE [CreateReportSchema] 
    [ReportName] = "TestReportTest2",
    [CustomFieldIdsPrimitive] = "1459925,1459928",
    [CustomFieldIdsDropdown] = "1469785",
    [CustomDimensionKeyIds] = "13539564",
    [BaseReportName] = "TestReportTest1", 
    [FileName] = "...\\TestReportTest2.rsd"

Input

Name Type Description
TableName String The name of the table for which the schema will be created.
ReportId String Id of the custom report.
WriteToFile String Indicates whether the schema should be saved as a file. Defaults to 'true'. Set to 'false' to output the schema as a stream using FileStream or FileData.
FileName String The full path and name of the file where the generated schema will be saved. If not provided, the TableName will be used as the file name.

Result Set Columns

Name Type Description
Result String Indicates whether the schema creation was successful ('Success') or failed ('Failure').
FileData String Returns the schema content as a base64-encoded string. Only provided when WriteToFile is set to 'false' and FileStream is not used.

Copyright (c) 2026 CData Software, Inc. - All rights reserved.
Build 25.0.9539.0