Analytics

Dataset Field Descriptions

Field descriptions can be added to Datasets to build shared understanding around business and logic definition. Descriptions support up to 350 characters, and text formatting such as bolding, italicizing, emojis, line breaks, and hyperlinks.

Get fields for a Dataset

To retrieve a list of the latest fields for a single Dataset, send a GET request including the Dataset token to the Dataset fields resource.

URL Params

account

required
string Account (Workspace or User) username

dataset

required
string Dataset token
Responses

200

DatasetField collection response

401

Unauthorized

404

Dataset not found

GET /{account}/datasets/{dataset}/fields

curl --include \
     --header "Content-Type: application/json" \
     --header "Accept: application/hal+json" \
  'https://app.mode.com/api/{account}/datasets/{dataset}/fields'
require 'http'

username = 'your_api_key'
password = 'your_api_secret'

headers = {
  content_type: 'application/json',
  accept: 'application/hal+json'
}

response = HTTP.basic_auth(user: username, pass: password)
               .headers(headers)
               .get('https://app.mode.com/api/{account}/datasets/{dataset}/fields')
puts response
from urllib2 import Request, urlopen

headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/hal+json'
}
request = Request('https://app.mode.com/api/{account}/datasets/{dataset}/fields', headers=headers)

response_body = urlopen(request).read()
print(response_body)
var request = new XMLHttpRequest();

request.open('GET', 'https://app.mode.com/api/{account}/datasets/{dataset}/fields');

request.setRequestHeader('Content-Type', 'application/json');
request.setRequestHeader('Accept', 'application/hal+json');

request.onreadystatechange = function () {
  if (this.readyState === 4) {
    console.log('Status:', this.status);
    console.log('Headers:', this.getAllResponseHeaders());
    console.log('Body:', this.responseText);
  }
};

request.send();

Get field descriptions for a Dataset

To retrieve a list of Dataset field descriptions for a given Dataset, send a GET request including the Dataset token to the Dataset field descriptions resource.

URL Params

account

required
string Account (Workspace or User) username

dataset

required
string Dataset token
Responses

200

DatasetFieldDescriptions collection response

401

Unauthorized

404

Dataset not found

GET /{account}/datasets/{dataset}/field_descriptions

curl --include \
     --header "Content-Type: application/json" \
     --header "Accept: application/hal+json" \
  'https://app.mode.com/api/{account}/datasets/{dataset}/field_descriptions'
require 'http'

username = 'your_api_key'
password = 'your_api_secret'

headers = {
  content_type: 'application/json',
  accept: 'application/hal+json'
}

response = HTTP.basic_auth(user: username, pass: password)
               .headers(headers)
               .get('https://app.mode.com/api/{account}/datasets/{dataset}/field_descriptions')
puts response
from urllib2 import Request, urlopen

headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/hal+json'
}
request = Request('https://app.mode.com/api/{account}/datasets/{dataset}/field_descriptions', headers=headers)

response_body = urlopen(request).read()
print(response_body)
var request = new XMLHttpRequest();

request.open('GET', 'https://app.mode.com/api/{account}/datasets/{dataset}/field_descriptions');

request.setRequestHeader('Content-Type', 'application/json');
request.setRequestHeader('Accept', 'application/hal+json');

request.onreadystatechange = function () {
  if (this.readyState === 4) {
    console.log('Status:', this.status);
    console.log('Headers:', this.getAllResponseHeaders());
    console.log('Body:', this.responseText);
  }
};

request.send();

Create a field description for a Dataset

To create a field description for a Dataset, send a POST request to the field descriptions resource with the Dataset, Dataset field description token, and Dataset field description request body.

URL Params

account

required
string Account (Workspace or User) username

dataset

required
string Dataset token
POST Body Params

Object: field_description

desc

string The description of the field

name

string The name of the field
Responses

200

DatasetFieldDescription response

400

Bad request

401

Unauthorized

404

Dataset not found

POST /{account}/datasets/{dataset}/field_descriptions

curl --include \
     --request POST \
     --header "Content-Type: application/json" \
     --header "Accept: application/hal+json" \
     --data-binary "{
  \"desc\": \"<p>Kanto Region Diaspora</p>\",
  \"name\": \"Region\"
}" \
'https://app.mode.com/api/{account}/datasets/{dataset}/field_descriptions/{field_description}'
require 'http'

values = {
  desc: '<p>Kanto Region Diaspora</p>',
  name: 'Region'
}

headers = {
  content_type: 'application/json',
  accept: 'application/hal+json'
}

response = HTTP.basic_auth(user: username, pass: password)
               .headers(headers)
               .post('https://app.mode.com/api/{account}/datasets/{dataset}/field_descriptions/{field_description}', json: values)
puts response
from urllib2 import Request, urlopen

values = """
  {
    "desc": "<p>Kanto Region Diaspora</p>",
    "name": "Region"
  }
"""

headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/hal+json'
}
request = Request('https://app.mode.com/api/{account}/datasets/{dataset}/field_descriptions/{field_description}', data=values, headers=headers)
request.get_method = lambda: 'POST'

response_body = urlopen(request).read()
print(response_body)
var request = require('request');

request({
  method: 'POST',
  url: 'https://app.mode.com/api/{account}/datasets/{dataset}/field_descriptions/{field_description}',
  headers: {
    'Content-Type': 'application/json',
    'Accept': 'application/hal+json'
  },
  body: "{ \"desc\": \"<p>Kanto Region Diaspora</p>\", \"name\": \"Region\" }"
}, function (error, response, body) {
  console.log('Status:', response.statusCode);
  console.log('Headers:', JSON.stringify(response.headers));
  console.log('Response:', body);
});

Update a field description for a Dataset

To update a given field description for a Dataset, send a PATCH request to the field descriptions resource with the Dataset, Dataset field description token, and Dataset field description request body.

URL Params

account

required
string Account (Workspace or User) username

dataset

required
string Dataset token

field description

required
string DatasetFieldDescription token
POST Body Params

Object: field_description

desc

string The description of the field
Responses

200

DatasetFieldDescription response

400

Bad request

401

Unauthorized

404

DatasetFieldDescription not found

PATCH /{account}/datasets/{dataset}/field_descriptions/{field_description}

curl --include \
     --request PATCH \
     --header "Content-Type: application/json" \
     --header "Accept: application/hal+json" \
     --data-binary "{
  \"desc\": \"<p>Kanto Region Diaspora</p>\"
}" \
'https://app.mode.com/api/{account}/datasets/{dataset}/field_descriptions/{field_description}'
require 'http'

values = {
  desc: '<p>Kanto Region Diaspora</p>'
}

headers = {
  content_type: 'application/json',
  accept: 'application/hal+json'
}

response = HTTP.basic_auth(user: username, pass: password)
               .headers(headers)
               .patch('https://app.mode.com/api/{account}/datasets/{dataset}/field_descriptions/{field_description}', json: values)
puts response
from urllib2 import Request, urlopen

values = """
  {
    "desc": "<p>Kanto Region Diaspora</p>"
  }
"""

headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/hal+json'
}
request = Request('https://app.mode.com/api/{account}/datasets/{dataset}/field_descriptions/{field_description}', data=values, headers=headers)
request.get_method = lambda: 'PATCH'

response_body = urlopen(request).read()
print(response_body)
var request = require('request');

request({
  method: 'PATCH',
  url: 'https://app.mode.com/api/{account}/datasets/{dataset}/field_descriptions/{field_description}',
  headers: {
    'Content-Type': 'application/json',
    'Accept': 'application/hal+json'
  },
  body: "{ \"desc\": \"<p>Kanto Region Diaspora</p>\" }"
}, function (error, response, body) {
  console.log('Status:', response.statusCode);
  console.log('Headers:', JSON.stringify(response.headers));
  console.log('Response:', body);
});

Delete a field description for a Dataset

To remove a given field description for a Dataset, send a DELETE request to the field descriptions resource with the Dataset and Dataset field description token.

URL Params

account

required
string Account (Workspace or User) username

dataset

required
string Dataset token

field description

required
string DatasetFieldDescription token
Responses

200

DatasetFieldDescription response

400

Bad request

401

Unauthorized

404

DatasetFieldDescription not found

DELETE /{account}/datasets/{dataset}/field_descriptions/{field_description}

curl --include \
     --request DELETE \
     --header "Content-Type: application/json" \
     --header "Accept: application/hal+json" \
  'https://app.mode.com/api/{account}/datasets/{dataset}/field_descriptions/{field_description}'
require 'http'

username = 'your_api_key'
password = 'your_api_secret'

headers = {
  content_type: 'application/json',
  accept: 'application/hal+json'
}

response = HTTP.basic_auth(user: username, pass: password)
               .headers(headers)
               .delete('https://app.mode.com/api/{account}/datasets/{dataset}/field_descriptions/{field_description}')
puts response
from urllib2 import Request, urlopen

headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/hal+json'
}
request = Request('https://app.mode.com/api/{account}/datasets/{dataset}/field_descriptions/{field_description}', headers=headers)
request.get_method = lambda: 'DELETE'

response_body = urlopen(request).read()
print(response_body)
var request = new XMLHttpRequest();

request.open('DELETE', 'https://app.mode.com/api/{account}/datasets/{dataset}/field_descriptions/{field_description}');

request.setRequestHeader('Content-Type', 'application/json');
request.setRequestHeader('Accept', 'application/hal+json');

request.onreadystatechange = function () {
  if (this.readyState === 4) {
    console.log('Status:', this.status);
    console.log('Headers:', this.getAllResponseHeaders());
    console.log('Body:', this.responseText);
  }
};

request.send();