NAV
shell javascript php java python

Introduction

Welcome to the Rownd API!

We have language bindings in Shell, JavaScript, php, java, and python! You can view code examples in the dark area to the right, and you can switch the programming language of the examples with the tabs in the top right. One of the most important aspects of Rownd is the ability for users to redact data that they own (their personal and private data). Please note the expected respones includes a "redacted" field for data that has been revoked from the application.

Authentication

To authorize, use this code:

# With shell, you can just pass the correct header with each request
curl "api_endpoint_here" \
 -H  "x-rownd-app-key: xxxxxxxxxxxx" \
 -H  "x-rownd-app-secret: xxxxxxxxxxxx"
var xhr = new XMLHttpRequest();
xhr.setRequestHeader("x-rownd-app-key", "xxxxxxxxxxxx");
xhr.setRequestHeader("x-rownd-app-secret", "xxxxxxxxxxxx");
  $curl = curl_init();
  curl_setopt($curl, CURLOPT_HTTPHEADER, array(
    'x-rownd-app-key: xxxxxxxxxxxx',
    'x-rownd-app-secret: xxxxxxxxxxxx',
  ));
  con.setRequestProperty("x-rownd-app-key", "xxxxxxxxxxxx");
  con.setRequestProperty("x-rownd-app-secret", "xxxxxxxxxxxx");

  my_headers = {'x-rownd-app-key' : 'xxxxxxxxxxxx','x-rownd-app-secret': 'xxxxxxxxxxxx' }
  response = requests.get('api_endpoint_here', headers=my_headers)

Make sure to replace xxxxxxxxxxxx with your API key and secret.

Rownd uses API keys to allow access to the API. You can get a new Rownd API key at our portal.

Rownd expects for the API key to be included in all API requests to the server in a header that looks like the following:

x-rownd-app-key: xxxxxxxxxxxx

x-rownd-app-secret: xxxxxxxxxxxx

Users Data

Get All Users' Data

This will return all data in the app. This is useful for large batch operations like sending bulk e-mails. Please note the "redacted" data types for each user. You will have to build error handling for these usecases in your app and processes.

curl "https://api.rownd.io/applications/<appId>/users/data" \
  -H  "accept: application/json" \
  -H  "x-rownd-app-key: xxxxxxxxxxxx" \
  -H  "x-rownd-app-secret: xxxxxxxxxxxx"
var url = "https://api.rownd.io/applications/<appId>/users/data";

var xhr = new XMLHttpRequest();
xhr.open("GET", url);

xhr.setRequestHeader("accept", "application/json");
xhr.setRequestHeader("x-rownd-app-key", "xxxxxxxxxxxx");
xhr.setRequestHeader("x-rownd-app-secret", "xxxxxxxxxxxx");
xhr.onreadystatechange = function () {
   if (xhr.readyState === 4) {
      console.log(xhr.status);
      console.log(xhr.responseText);
   }};

xhr.send();

  $url = "https://api.rownd.io/applications/<appId>/users/data";

  $curl = curl_init();
  curl_setopt($curl, CURLOPT_URL, $url);
  curl_setopt($curl, CURLOPT_HTTPHEADER, array(
    'x-rownd-app-key: xxxxxxxxxxxx',
    'x-rownd-app-secret: xxxxxxxxxxxx',
  ));
  curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
  curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
  // EXECUTE:
  $result = curl_exec($curl);
  if(!$result){die("Connection Failure");}
  curl_close($curl);
  URL url = new URL("https://api.rownd.io/applications/<appId>/users/data");
  HttpURLConnection con = (HttpURLConnection) url.openConnection();
  con.setRequestMethod("GET");
  con.setRequestProperty("x-rownd-app-key", "xxxxxxxxxxxx");
  con.setRequestProperty("x-rownd-app-secret", "xxxxxxxxxxxx");
  con.setRequestProperty("accept", "application/json");

   if (con.getResponseCode() != 200) {
      throw new RuntimeException("Failed : HTTP error code : "
              + con.getResponseCode());
  }

  BufferedReader br = new BufferedReader(new InputStreamReader(
      (con.getInputStream())));
  import requests
  my_headers = {'x-rownd-app-key' : 'xxxxxxxxxxxx','x-rownd-app-secret': 'xxxxxxxxxxxx' }
  response = requests.get('https://api.rownd.io/applications/<appId>/users/data', headers=my_headers)
  print(response)

The above command returns JSON structured like this:

{
  "total_results": 0,
  "results": [
    {
      "rownd_user": "string",
      "data": {
        "additionalProp1": {}
      },
      "redacted": [
        "string"
      ],
      "revoke_after": {
        "additionalProp1": "string",
        "additionalProp2": "string",
        "additionalProp3": "string"
      },
      "retain_until": {
        "additionalProp1": "string",
        "additionalProp2": "string",
        "additionalProp3": "string"
      }
    }
  ]
}

This endpoint retrieves all users.

HTTP Request

GET https://api.rownd.io/applications/<appId>/users/data

Query Parameters

Parameter Description
appId The ID of the application

Get a Specific User's Data

curl "https://api.rownd.io/applications/<appId>/users/<userId>/data" \
  -H  "accept: application/json" \
  -H  "x-rownd-app-key: xxxxxxxxxxxx" \
  -H  "x-rownd-app-secret: xxxxxxxxxxxx"
var url = "https://api.rownd.io/applications/<appId>/users/<userId>/data";

var xhr = new XMLHttpRequest();
xhr.open("GET", url);

xhr.setRequestHeader("accept", "application/json");
xhr.setRequestHeader("x-rownd-app-key", "xxxxxxxxxxxx");
xhr.setRequestHeader("x-rownd-app-secret", "xxxxxxxxxxxx");
xhr.onreadystatechange = function () {
   if (xhr.readyState === 4) {
      console.log(xhr.status);
      console.log(xhr.responseText);
   }};

xhr.send();
  $url = "https://api.rownd.io/applications/<appId>/users/<userId>/data";

  $curl = curl_init();
  curl_setopt($curl, CURLOPT_URL, $url);
  curl_setopt($curl, CURLOPT_HTTPHEADER, array(
    'x-rownd-app-key: xxxxxxxxxxxx',
    'x-rownd-app-secret: xxxxxxxxxxxx',
  ));
  curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
  curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
  // EXECUTE:
  $result = curl_exec($curl);
  if(!$result){die("Connection Failure");}
  curl_close($curl);
  URL url = new URL("https://api.rownd.io/applications/<appId>/users/<userId>/data");
  HttpURLConnection con = (HttpURLConnection) url.openConnection();
  con.setRequestMethod("GET");
  con.setRequestProperty("x-rownd-app-key", "xxxxxxxxxxxx");
  con.setRequestProperty("x-rownd-app-secret", "xxxxxxxxxxxx");
  con.setRequestProperty("accept", "application/json");

   if (con.getResponseCode() != 200) {
      throw new RuntimeException("Failed : HTTP error code : "
              + con.getResponseCode());
  }

  BufferedReader br = new BufferedReader(new InputStreamReader(
      (con.getInputStream())));
  import requests
  my_headers = {'x-rownd-app-key' : 'xxxxxxxxxxxx','x-rownd-app-secret': 'xxxxxxxxxxxx' }
  response = requests.get('https://api.rownd.io/applications/<appId>/users/<userId>/data', headers=my_headers)
  print(response)

The above command returns JSON structured like this:

{
  "rownd_user": "string",
  "data": {
    "additionalProp1": {}
  },
  "redacted": [
    "string"
  ],
  "revoke_after": {
    "additionalProp1": "string",
    "additionalProp2": "string",
    "additionalProp3": "string"
  },
  "retain_until": {
    "additionalProp1": "string",
    "additionalProp2": "string",
    "additionalProp3": "string"
  }
}

This endpoint retrieves a specific User.

HTTP Request

GET https://api.rownd.io/applications/<appId>/users/<userId>/data

URL Parameters

Parameter Description
appId The ID of the application
userId The ID of the user to retrieve

Create a user and save a Specific User's Data

To create a new user, you simply have to pass a string in the URL (). You can use any construct you want. We recommend using the same userID as you have for your app.

To send data, you simply have to create a data object using data types you defined for the app:

curl "https://api.rownd.io/applications/<appId>/users/<userId>/data" \
  -X PUT \
  -H  "accept: application/json" \
  -H  "Content-Type: application/json" \
  -H  "x-rownd-app-key: xxxxxxxxxxxx" \
  -H  "x-rownd-app-secret: xxxxxxxxxxxx"
  -d  "{"data":{"datatype":"xxxxx", "datatype2":"xxxxxxx"}}"
var url = "https://api.rownd.io/applications/<appId>/users/<userId>/data";

var xhr = new XMLHttpRequest();
xhr.open("PUT", url);

xhr.setRequestHeader("accept", "application/json");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.setRequestHeader("x-rownd-app-key", "xxxxxxxxxxxx");
xhr.setRequestHeader("x-rownd-app-secret", "xxxxxxxxxxxx");
xhr.onreadystatechange = function () {
   if (xhr.readyState === 4) {
      console.log(xhr.status);
      console.log(xhr.responseText);
   }};

var data = {"data":{"datatype":"xxxxx", "datatype2":"xxxxxxx"}};

xhr.send(data);
  $url = "https://api.rownd.io/applications/<appId>/users/<userId>/data";
  $data = {"data":{"datatype":"xxxxx", "datatype2":"xxxxxxx"}};

  $curl = curl_init();
  curl_setopt($curl, CURLOPT_URL, $url);
  curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "PUT");
  curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
  curl_setopt($curl, CURLOPT_HTTPHEADER, array(
    'x-rownd-app-key: xxxxxxxxxxxx',
    'x-rownd-app-secret: xxxxxxxxxxxx',
    'Content-Type: application/json'
  ));
  curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
  curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
  // EXECUTE:
  $result = curl_exec($curl);
  if(!$result){die("Connection Failure");}
  curl_close($curl);
  URL url = new URL("https://api.rownd.io/applications/<appId>/users/<userId>/data");
  HttpURLConnection con = (HttpURLConnection) url.openConnection();
  con.setRequestMethod("PUT");
  con.setRequestProperty("x-rownd-app-key", "xxxxxxxxxxxx");
  con.setRequestProperty("x-rownd-app-secret", "xxxxxxxxxxxx");
  con.setRequestProperty("Content-Type", "application/json");

  String input = {"data":{"datatype":"xxxxx", "datatype2":"xxxxxxx"}};

  OutputStream os = conn.getOutputStream();
  os.write(input.getBytes());
  os.flush();

   if (con.getResponseCode() != 200) {
      throw new RuntimeException("Failed : HTTP error code : "
              + con.getResponseCode());
  }

  BufferedReader br = new BufferedReader(new InputStreamReader(
      (con.getInputStream())));
  import requests
  my_headers = {'x-rownd-app-key' : 'xxxxxxxxxxxx','x-rownd-app-secret': 'xxxxxxxxxxxx', 'Content-Type':'application/json' }
  response = requests.put('https://api.rownd.io/applications/<appId>/users/<userId>/data', headers=my_headers, data = {"data":{"additionalProp1" : {}}})
  print(response)

The above command returns JSON structured like this:

{
  "rownd_user": "string",
  "data": {
    "additionalProp1": {}
  },
  "redacted": [
    "string"
  ],
  "revoke_after": {
    "additionalProp1": "string",
    "additionalProp2": "string",
    "additionalProp3": "string"
  },
  "retain_until": {
    "additionalProp1": "string",
    "additionalProp2": "string",
    "additionalProp3": "string"
  }
}

This endpoint save a specific user.

HTTP Request

PUT https://api.rownd.io/applications/<appId>/users/<userId>/data

URL Parameters

Parameter Description
appId The ID of the application
userId The ID of the user to retrieve

Delete a Specific User's Data

curl "https://api.rownd.io/applications/<appId>/users/<userId>/data" \
  -X DELETE \
  -H  "x-rownd-app-key: xxxxxxxxxxxx" \
  -H  "x-rownd-app-secret: xxxxxxxxxxxx"
var url = "https://api.rownd.io/applications/<appId>/users/<userId>/data";

var xhr = new XMLHttpRequest();
xhr.open("DELETE", url);

xhr.setRequestHeader("accept", "application/json");
xhr.setRequestHeader("x-rownd-app-key", "xxxxxxxxxxxx");
xhr.setRequestHeader("x-rownd-app-secret", "xxxxxxxxxxxx");
xhr.onreadystatechange = function () {
   if (xhr.readyState === 4) {
      console.log(xhr.status);
      console.log(xhr.responseText);
   }};

xhr.send();
  $url = "https://api.rownd.io/applications/<appId>/users/<userId>/data";

  $curl = curl_init();
  curl_setopt($curl, CURLOPT_URL, $url);
  curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE");
  curl_setopt($curl, CURLOPT_HTTPHEADER, array(
    'x-rownd-app-key: xxxxxxxxxxxx',
    'x-rownd-app-secret: xxxxxxxxxxxx',
  ));
  curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
  curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
  // EXECUTE:
  $result = curl_exec($curl);
  if(!$result){die("Connection Failure");}
  curl_close($curl);
  URL url = new URL("https://api.rownd.io/applications/<appId>/users/<userId>/data");
  HttpURLConnection con = (HttpURLConnection) url.openConnection();
  con.setRequestMethod("DELETE");
  con.setRequestProperty("x-rownd-app-key", "xxxxxxxxxxxx");
  con.setRequestProperty("x-rownd-app-secret", "xxxxxxxxxxxx");

   if (con.getResponseCode() != 200) {
      throw new RuntimeException("Failed : HTTP error code : "
              + con.getResponseCode());
  }

  BufferedReader br = new BufferedReader(new InputStreamReader(
      (con.getInputStream())));
  import requests
  my_headers = {'x-rownd-app-key' : 'xxxxxxxxxxxx','x-rownd-app-secret': 'xxxxxxxxxxxx' }
  response = requests.delete('https://api.rownd.io/applications/<appId>/users/<userId>/data', headers=my_headers)
  print(response)

This endpoint delete a specific User.

HTTP Request

DELETE https://api.rownd.io/applications/<appId>/users/<userId>/data

URL Parameters

Parameter Description
appId The ID of the application
userId The ID of the user to retrieve