Skip to main content

Integration

API Integration

REST API Endpoints Node-RED provides comprehensive REST APIs for flow management:

javascript

// Flow Management
GET /flows // Get all flows
POST /flows // Deploy flows
GET /flow/:id // Get specific flow
PUT /flow/:id // Update flow
DELETE /flow/:id // Delete flow
// Node Management
GET /nodes // Get installed nodes
POST /nodes // Install node
DELETE /nodes/:module // Remove node

Authentication Headers

javascript


// Basic authentication
const auth = Buffer.from('username:password').toString('base64');
const headers = {
'Authorization': `Basic ${auth}`,
'Content-Type': 'application/json'
};

Database Integration

MySQL Integration

javascript


// Install MySQL node
npm install node-red-node-mysql
// Configuration example
{
"host": "localhost",
"port": 3306,
"user": "node_red",
"password": "password",
"database": "production_db"
}

MongoDB Integration

javascript


// Install MongoDB node
npm install node-red-contrib-mongodb3
// Connection example
{
"uri": "mongodb://localhost:27017/mydb",
"options": {
"useUnifiedTopology": true
}
}

Message Queue Integration

MQTT Configuration

javascript

// Built-in MQTT support
{
"server": "mqtt://broker.example.com:1883",
"clientId": "node-red-client",
"username": "mqtt_user",
"password": "mqtt_pass",
"keepalive": 60,
"cleansession": true
}

RabbitMQ Integration

javascript


// Install RabbitMQ node
npm install node-red-contrib-amqp
// Configuration
{
"host": "localhost",
"port": 5672,
"vhost": "/",
"username": "guest",
"password": "guest"
}

External Service Integration

HTTP Request Configuration

javascript


// HTTP request node settings
{
"method": "POST",
"url": "https://api.example.com/endpoint",
"headers": {
"Content-Type": "application/json",
"Authorization": "Bearer token"
},
"timeout": 30000,
"retry": 3
}

Webhook Integration

javascript


// HTTP input node for webhooks
{
"method": "post",
"url": "/webhook/:id",
"swaggerDoc": "",
"x": 100,
"y": 100
}