# Transform a CSV file stream (Batch Mode)
curl -X POST http://localhost:3005/api/v1/process \
-H "Authorization: Bearer YOUR_API_KEY_HERE" \
-F "templateId=YOUR_TEMPLATE_UUID_HERE" \
-F "file=@your_input_data.csv" \
--output transformed_output.csv
# Transform real-time records in JSON (Webhook Mode)
curl -X POST http://localhost:3005/api/v1/process/json \
-H "Authorization: Bearer YOUR_API_KEY_HERE" \
-H "Content-Type: application/json" \
-d '{
"templateId": "YOUR_TEMPLATE_UUID_HERE",
"records": [
{ "First Name": "John", "Surname": "Watson", "Phone": "07700 900077" }
]
}'
import requests
# 1. Transform a CSV file stream
url_csv = "http://localhost:3005/api/v1/process"
headers = {"Authorization": "Bearer YOUR_API_KEY_HERE"}
data = {"templateId": "YOUR_TEMPLATE_UUID_HERE"}
files = {"file": open("raw_input.csv", "rb")}
response = requests.post(url_csv, headers=headers, data=data, files=files, stream=True)
if response.status_code == 200:
with open("transformed_output.csv", "wb") as f:
for chunk in response.iter_content(chunk_size=8192):
f.write(chunk)
# 2. Transform real-time JSON records
url_json = "http://localhost:3005/api/v1/process/json"
payload = {
"templateId": "YOUR_TEMPLATE_UUID_HERE",
"records": [
{"First Name": "John", "Surname": "Watson", "Phone": "07700 900077"}
]
}
res = requests.post(url_json, headers=headers, json=payload)
print(res.json())
const axios = require('axios');
const fs = require('fs');
const FormData = require('form-data');
// 1. Transform a CSV file stream
const form = new FormData();
form.append('templateId', 'YOUR_TEMPLATE_UUID_HERE');
form.append('file', fs.createReadStream('./raw_input.csv'));
axios.post('http://localhost:3005/api/v1/process', form, {
headers: {
...form.getHeaders(),
'Authorization': 'Bearer YOUR_API_KEY_HERE'
},
responseType: 'stream'
})
.then(response => {
response.data.pipe(fs.createWriteStream('./transformed_output.csv'));
});
// 2. Transform real-time JSON records
const payload = {
templateId: 'YOUR_TEMPLATE_UUID_HERE',
records: [
{ 'First Name': 'John', 'Surname': 'Watson', 'Phone': '07700 900077' }
]
};
axios.post('http://localhost:3005/api/v1/process/json', payload, {
headers: { 'Authorization': 'Bearer YOUR_API_KEY_HERE' }
})
.then(res => console.log(res.data));