NodeJS

Get data

var request = require('request');
var options = {
'method': 'GET',
'url': 'https://api.getdatapipe.com/v1/data/<your account ID>/<your endpoint ID>',
'headers': {
'Content-Type': 'application/json',
'x-api-key': '<you api key>',
'user': 'user@sample.com'
}
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});

Transform a file

var request = require('request');
var fs = require('fs');
var options = {
'method': 'POST',
'url': 'https://api.getdatapipe.com/v1/data/<your account ID>/<your endpoint ID>/file',
'headers': {
'Content-Type': 'application/x-www-form-urlencoded',
'x-api-key': '<your api key>',
'user': 'user@sample.com'
},
formData: {
'file': {
'value': fs.createReadStream('/path/to/demo-01.csv'),
'options': {
'filename': 'demo-01.csv',
'contentType': null
}
}
}
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});

Transform a Google Sheet

var request = require('request');
var options = {
'method': 'POST',
'url': 'https://api.getdatapipe.com/v1/data/<your account ID>/<your endpoint ID>/sheet',
'headers': {
'Content-Type': 'application/x-www-form-urlencoded',
'x-api-key': '<your api key>',
'user': 'user@sample.com'
},
form: {
'spreadsheetId': 'Google Sheet ID'
}
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});