API Gateway

The API Gateway component in DatErica enables users to send and receive data through HTTP GET and POST requests, facilitating seamless integration with external systems.

API Gateway Configuration

Overview

The API Gateway allows users to:

  • Send POST requests with payloads (JSON, CSV, XML).
  • Use GET requests to retrieve processed data or trigger pipeline runs.
  • Choose whether to return the processing result in the response.

Configuration Steps

  1. Open Component Config: Navigate to the API Gateway component configuration interface.

  2. Select API Key: Choose an existing API key or create a new one directly within the interface. To create a new API key, click on 'Create New API Key' and follow the prompts.

  3. Enable Test Mode: Toggle 'Test Mode' to ON. This activates the API Gateway to listen for incoming requests at the provided endpoint.

  4. Make a Test Request: The request can be made using tools like curl, Postman, or directly from your application. Ensure the payload (if using POST) is formatted correctly. It can be raw JSON, CSV, XML, or a file provided as binary or form data (with the key 'file').

  5. Verify Test Request: Once the test request is processed, the GUI will display a message confirming the successful handling of the request. A data structure example of the provided request will be shown. This structure will be used for configuring subsequent components.

  6. Save Configuration: After verifying the test request, click 'Save Config' to apply and save the settings.

Detailed Settings

  • HTTP Method: Choose between GET and POST for your API requests.
  • Endpoint URL: This is auto-generated and unique for your configuration.
  • Return Processing Result: Toggle this option to include the result of the data processing in the response.
  • API Key: Manage your API keys directly within the configuration interface.
  • Test Mode: Enables a safe testing environment before saving the configuration.

Example Test Request

curl --location https://api.daterica.com/668af7c121fa342bf119511a \
--header 'x-api-key: ********' \
--header 'Content-Type: application/json' \
--data '{ "key": "value" }'

Replace the x-api-key value placeholder with actual data and use the correct endpoint URL generated for your configuration. Use also your actual payload data.

Common Use Cases

  • POST Request: Send data to the API Gateway for processing. Suitable for real-time data ingestion and transformation.
  • GET Request: Retrieve processed data, or trigger specific pipelines, or fetch data from different storages with various transformations in the middle.

Finalizing Configuration

After saving the configuration, your API Gateway will be ready to handle production requests. Ensure that all subsequent components in your pipeline are configured based on the data structure obtained during the test request.