v5.0 - v5.5 Data Sync Documentation
  • Overview
  • Release Notes
    • V4.5
    • V4.6
    • v4.7
    • v4.8
    • v4.9
    • v4.10
    • v4.12
    • v4.13
  • v4 Connections Installation Guide
    • v5 Connections and CLI Installation Guide
  • v4 Worker/Listener Installation Guide
    • v5 Worker/Listener Installation Guide
  • Upgrades & Config Changes
  • Builder Guide
    • Overview
    • Types of Data Syncs
    • Subscribing to Event Streams
      • Supported Stream Sources
        • Amazon Simple Queue Service (SQS)
        • Cinchy Change Data Capture
        • Data Polling
        • Kafka Topic
        • MongoDB
        • Salesforce
          • Push Topic
          • Platform Event
    • Configuring a Data Sync
      • Connections Experience & XML Config Reference
        • Info
          • Parameters
            • String Escape
        • Source Config Reference
          • Schema Columns
            • Calculated Column Examples
          • Auth Requests
          • Request Headers
          • Pagination
          • Source Filter
        • Target Destination Config Reference
          • Column Mappings
          • Target Destination Filter
        • Sync Behaviour
        • Post Sync
        • Permissions
        • Jobs
        • Connections Usage Example
      • Data Validation
      • Transformations
        • StringReplacement
      • Supported Data Sources
        • File Based Source
          • Binary File
            • Binary File Data Source Example
          • Delimited File
            • Delimited File Data Source XML Example
          • Fixed Width File
          • Excel
            • Excel Source XML Example
        • Cinchy Event Broker/CDC
          • Cinchy Event Broker/CDC XML Config Example
        • Cinchy Table
          • Cinchy Table XML Config Example
        • Cinchy Query
          • Cinchy Query Data Source Example
        • Copper
        • DB2
        • Dynamics 2015
        • Dynamics
        • DynamoDB
        • Kafka Topic
          • Apache AVRO Data Format
          • Kafka Topic Source Example
        • LDAP
        • MongoDB Collection
          • MongoDB Collection Source XML Example
        • MongoDB Collection (Cinchy Event Triggered)
        • MS SQL Server Query
        • MS SQL Server Table
        • ODBC Table
        • ODBC Query
        • Oracle Table
        • Oracle Query
        • Parquet
        • Polling Event
          • Polling Event Example
        • REST API (Cinchy Event Triggered)
        • REST API
          • REST API XML Example
        • SAP SuccessFactors
        • Salesforce Object (Bulk API)
        • Salesforce Platform Event
        • Salesforce Push Topic
        • Snowflake
          • Snowflake Source XML Example
        • SOAP 1.2 Web Service
      • Supported Sync Targets
        • Cinchy Table
        • DB2 Table
        • Dynamics
        • Kafka Topic
        • MongoDB Collection (Column Based)
        • MS SQL Server Table
        • Oracle Table
        • REST API
        • Salesforce
        • Salesforce Object
        • Snowflake Table
          • Snowflake Table Target XML Example
        • SOAP 1.2 Web Service
    • Common Design Patterns
    • Testing a Data Sync
    • Promoting a Data Sync
    • Scheduling a Data Sync
    • CLI Command List
    • Connections Functions
    • Monitoring
  • Cinchy Platform Documentation
Powered by GitBook
On this page
  • Dataset
  • Sample Response
  • Data Sync Config
  • Table Model

Was this helpful?

  1. Builder Guide
  2. Configuring a Data Sync
  3. Supported Data Sources
  4. REST API

REST API XML Example

A currency example with the REST API connector.

PreviousREST APINextSAP SuccessFactors

Last updated 2 years ago

Was this helpful?

Dataset

This is an FX price dataset provided by CLS on Quandl. You can find the documentation for the API here:

Sample Response

{
  "datatable": {
    "data": [
      [
        "USDCAD",
        "SPT",
        "2018-01-02",
        "2018-01-02",
        12,
        0,
        1.2548,
        1.25479,
        1.25479,
        1.25479
      ],
      [
        "USDCAD",
        "SPT",
        "2018-01-02",
        "2018-01-02",
        12,
        5,
        1.25453,
        1.25454,
        1.25451,
        1.25452
      ],
      [
        "USDCAD",
        "SPT",
        "2018-01-02",
        "2018-01-02",
        12,
        10,
        1.25417,
        1.25418,
        1.25418,
        1.25418
      ],
      [
        "USDCAD",
        "SPT",
        "2018-01-02",
        "2018-01-02",
        12,
        15,
        1.25416,
        1.25415,
        1.25415,
        1.25414
      ]
    ],
    "columns": [
      {
        "name": "currency",
        "type": "String"
      },
      {
        "name": "instrument",
        "type": "String"
      },
      {
        "name": "fx_business_date",
        "type": "Date"
      },
      {
        "name": "london_date",
        "type": "Date"
      },
      {
        "name": "hour",
        "type": "Integer"
      },
      {
        "name": "minute",
        "type": "Integer"
      },
      {
        "name": "vwap_matched",
        "type": "double"
      },
      {
        "name": "twap_matched",
        "type": "double"
      },
      {
        "name": "vwap_unmatched",
        "type": "double"
      },
      {
        "name": "twap_unmatched",
        "type": "double"
      }
    ]
  },
  "meta": {
    "next_cursor_id": null
  }
}

Data Sync Config

Note that you'll have to get your own api key to use the endpoint.

<?xml version="1.0" encoding="utf-16"?>
<BatchDataSyncConfig name="Quandl CLS FX Prices" version="1.0.0" xmlns="http://www.cinchy.co">
    <Parameters>
    <Parameter name="date" />
    </Parameters>
    <RestApiDataSource  format="JSON" 
                        rootPath="$.datatable.data" 
                        endpoint="https://www.quandl.com/api/v3/datatables/CLS/IDHP?fx_business_date=@date&amp;api_key=API_KEY"
                        nextPageUrlPath="$.meta.next_cursor_id">
        <Schema>
            <Column name="$.item[0]" dataType="Text" />
            <Column name="$.item[3]" dataType="Date" />
            <Column name="$.item[4]" dataType="Number" />
            <Column name="$.item[5]" dataType="Number" />
            <Column name="$.item[6]" dataType="Number" />
            <Column name="$.item[7]" dataType="Number" />
            <CalculatedColumn name="Date" formula="CONCAT(@date,'')" dataType="Date" />
        </Schema>
    </RestApiDataSource>
    <CinchyTableTarget model="" domain="FX" table="CLS Prices" suppressDuplicateErrors="false">
        <ColumnMappings>
            <ColumnMapping sourceColumn="$.item[0]" targetColumn="Currency" linkColumn="CLSFX Abbreviation"/>
            <ColumnMapping sourceColumn="$.item[3]" targetColumn="Date"/>
            <ColumnMapping sourceColumn="$.item[4]" targetColumn="Hour"/>
            <ColumnMapping sourceColumn="$.item[5]" targetColumn="Minute"/>
            <ColumnMapping sourceColumn="$.item[6]" targetColumn="VWAP Matched"/>
            <ColumnMapping sourceColumn="$.item[7]" targetColumn="TWAP Matched"/>
        </ColumnMappings>
        <SyncKey>
            <SyncKeyColumnReference name="Currency" />
            <SyncKeyColumnReference name="Date" />
            <SyncKeyColumnReference name="Hour" />
            <SyncKeyColumnReference name="Minute" />
        </SyncKey>
        <NewRecordBehaviour type="INSERT" />
        <ChangedRecordBehaviour type="UPDATE" />
        <DroppedRecordBehaviour type="DELETE" />
    </CinchyTableTarget>
</BatchDataSyncConfig>
.\Cinchy.CLI.exe syncdata -s "CinchyURL" -u "username" -p "password" -m "Cinchy" -f "Quandl CLS FX Prices" -d "C:\temp" -v date:"2018-01-02"

Table Model

This model and reference data will allow you to run the data sync above in your own environment.

https://www.quandl.com/databases/CLSRP/documentation
4KB
CLS Prices.xml
Currencies Model
503B
Currencies.csv
Currencies Data Import
1KB
Currency Pairs.csv
Currency Pairs Data Import