Ruby

Get data

require "uri"
require "net/http"
url = URI("https://api.getdatapipe.com/v1/data/<your account ID>/<your endpoint ID>")
https = Net::HTTP.new(url.host, url.port);
https.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Content-Type"] = "application/json"
request["x-api-key"] = "<you api key>"
request["user"] = "user@sample.com"
response = https.request(request)
puts response.read_body

Transform a file

require "uri"
require "net/http"
url = URI("https://api.getdatapipe.com/v1/data/<your account ID>/<your endpoint ID>/file")
https = Net::HTTP.new(url.host, url.port);
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/x-www-form-urlencoded"
request["x-api-key"] = "<your api key>"
request["user"] = "user@sample.com"
form_data = [['file', File.open('/path/to/demo-01.csv')]]
request.set_form form_data, 'multipart/form-data'
response = https.request(request)
puts response.read_body

Transform a Google Sheet

require "uri"
require "net/http"
url = URI("https://api.getdatapipe.com/v1/data/<your account ID>/<your endpoint ID>/sheet")
https = Net::HTTP.new(url.host, url.port);
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/x-www-form-urlencoded"
request["x-api-key"] = "<your api key>"
request["user"] = "user@sample.com"
request.body = "spreadsheetId=Google%20Sheet%20ID"
response = https.request(request)
puts response.read_body