Java

Get data

OkHttpClient client = new OkHttpClient().newBuilder()
.build();
Request request = new Request.Builder()
.url("https://api.getdatapipe.com/v1/data/<your account ID>/<your endpoint ID>")
.method("GET", null)
.addHeader("Content-Type", "application/json")
.addHeader("x-api-key", "<you api key>")
.addHeader("user", "user@sample.com")
.build();
Response response = client.newCall(request).execute();

Transform a file

OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
.addFormDataPart("file","demo-01.csv",
RequestBody.create(MediaType.parse("application/octet-stream"),
new File("/path/to/demo-01.csv")))
.build();
Request request = new Request.Builder()
.url("https://api.getdatapipe.com/v1/data/<your account ID>/<your endpoint ID>/file")
.method("POST", body)
.addHeader("Content-Type", "application/x-www-form-urlencoded")
.addHeader("x-api-key", "<your api key>")
.addHeader("user", "user@sample.com")
.build();
Response response = client.newCall(request).execute();

Transform a Google Sheet

OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
RequestBody body = RequestBody.create(mediaType, "spreadsheetId=Google Sheet ID");
Request request = new Request.Builder()
.url("https://api.getdatapipe.com/v1/data/<your account ID>/<your endpoint ID>/sheet")
.method("POST", body)
.addHeader("Content-Type", "application/x-www-form-urlencoded")
.addHeader("x-api-key", "<your api key>")
.addHeader("user", "user@sample.com")
.build();
Response response = client.newCall(request).execute();