Skip to content

REST - DATA SINK

Description

The REST data sink is designed to distribute data by sending it to a RESTful API endpoint. This method is particularly useful for integrating with web services and APIs, allowing for real-time data processing and analysis. The REST data sink supports various configuration options to customize the data distribution process, including specifying the API endpoint URL, HTTP method, headers, request parameters, and body content.


Config

REQUIRED


Config Parameters

Name Description
url The RESTful API endpoint URL where the data will be sent. This is a required parameter.
method The HTTP method (e.g., GET, POST, PUT) to use for the request. This is a required parameter.
headers A set of HTTP headers to include in the request. This is an optional parameter.
requestParams A set of query parameters to include in the request. This is an optional parameter.
mappings A set of mappings to transform the data before sending it. This is an optional parameter.
substitutions A set of substitutions to apply to the data before sending it. This is an optional parameter.
metaData Metadata to include with the request. This is an optional parameter.

Config Example

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
<?xml version="1.0" encoding="UTF-8"?>
<apiroConf version="1" xmlns="http://apiro.com/apiro/v1/root">
    <loadOrder>10</loadOrder>
    <dataSinks>
        <dataSink definition="REST" execPriority="10" name="ESG_DATA_OPS_REST">
            <config>
                <![CDATA[
                    {
                        "url":"https://mycompany.com.au/rest/data/esg/",
                        "method":"POST",
                        "headers":{},
                        "requestParams":{},
                        "mappings":{},
                        "substitutions":{},
                        "metaData":{}
                    }
                ]]>
            </config>
        </dataSink>
    </dataSinks>
</apiroConf>

Common Mistakes

  • Incorrect URL: Ensure that the url parameter is a valid URL and points to an existing RESTful API endpoint.
  • Unsupported HTTP Method: Verify that the method parameter is a supported HTTP method for the specified API endpoint.
  • Incorrect Headers or Parameters: If you encounter issues with the request, check the headers and requestParams for any errors or missing required fields.
  • Data Transformation Errors: If the data transformation specified by mappings or substitutions fails, ensure that the transformation rules are correctly defined.
  • Network Issues: If you encounter connectivity issues, check the network configuration and ensure that the RESTful API endpoint is accessible from the machine running the data sink.