Skip to main content

Simple REST API Connector - LDS Integration

Description

This connector demonstrates a basic REST API integration with header-based authentication. The LDS V3 connector shows how to configure external API endpoints with environment-specific variables for base URLs and API keys. This pattern is commonly used for integrating with third-party services that require simple API key authentication through headers. The connector uses environment variables for configuration, making it easy to manage different endpoints across development, staging, and production environments.

Use Case

Used in a lottery and donation system to integrate with an external LDS (Lottery Distribution System) API. The connector facilitates communication for lottery ticket management, draw results, and subscription services. It provides a centralized configuration point for all LDS API interactions throughout the application.

Key Features

  • Environment variable substitution for configuration
  • Header-based API key authentication
  • JSON content type specification
  • Simple REST API type designation
  • Centralized configuration for multiple API endpoints
  • Environment-specific URL management

JSON Definition

{
"name": "LDS V3",
"key": "lds_v3",
"description": "LDS V3",
"configuration": {
"baseUrl": "%%LDSV3_BaseUrl%%",
"headers": {
"Accept": "application/json",
"Api-Key": "%%LDSV3_ApiKey%%"
},
"authentication": {}
},
"type": "rest_api"
}

Notes

  • Environment variables use the %%VARIABLE_NAME%% syntax
  • The empty authentication object indicates header-based auth is used
  • The Accept header ensures proper content negotiation
  • Base URL can be changed per environment without code changes
  • API keys are stored securely in environment configuration
  • This pattern supports multiple API versions through different connectors