Analytics
Form Fields
You can use the form fields resource to list the parameter options available for a report run.
Form Field object
Properties | |
name required |
string |
options required |
string |
options_error required |
string |
source_size required |
string |
{
"name": "numbers_100k",
"options": [[1, "2012020001_1"], [2, "2012020001_10"], [3, "2012020001_100"]],
"options_error": null,
"source_size": 510988
}
List form fields
To return a list of all Form Fields for a given Report Run, send a GET request to the Report Runs’s options
endpoint.
URL Params | ||
account required |
string |
Account (Workspace or User ) username
|
report required |
string |
Report token
|
run required |
string |
ReportRun token
|
Responses | |
200 |
FormField collection response |
400 |
Bad request |
401 |
Unauthorized |
404 |
ReportRun not found |
GET
/{account}
curl --include \
--header "Content-Type: application/json" \
--header "Accept: application/hal+json" \
'https://app.mode.com/api/{account}/reports/{report}/runs/{run}/options'
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}/reports/{report}/runs/{run}/options')
puts response
from urllib2 import Request, urlopen
headers = {
'Content-Type': 'application/json',
'Accept': 'application/hal+json'
}
request = Request('https://app.mode.com/api/{account}/reports/{report}/runs/{run}/options', headers=headers)
response_body = urlopen(request).read()
print(response_body)
var request = new XMLHttpRequest();
request.open('GET', 'https://app.mode.com/api/{account}/reports/{report}/runs{run}/options');
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);
}
};