Get Record's Historical Data
View all/filtered historical records with/without paging of one specific record.
| Description | Returns all/filtered historical records with or without the paging of one specific record associated with a particular board |
|---|---|
| URL | /board/[boardname]/display/[displayviewname]/history/{prevdataid} |
| Method | POST |
| Parameters |
|
Review the parameter definitions and examples of how to use the GetFilteredHistoricalDataByPageNumber endpoint in JavaScript and C# calls.
Parameters
| Variable Name | Type | Description | Required |
|---|---|---|---|
| boardname | String | Name of the board containing the records you want to retrieve | True (URL) |
| displayviewname | String | Name of the view that displays the records you want to retrieve | True (URL) |
| prevdataid | Integer | Unique ID of the board record you want to retrieve historical data | True (URL) |
Headers
| Key Name | Value | Description | |
|---|---|---|---|
| X-Paging-Page | Integer | Number of the page the records you want to retrieve | False |
| X-Paging-PageSize | Integer | Number of the records per page you want to retrieve | False |
Examples
JavaScript Call
Copy Code
// Get all historical data.
await fetch(`${baseUrl}/board/Shelters/display/List/history/1`,{
method: 'POST'
});
// Get filtered historical data.
var filteredDataObject = {
viewFilters: ["ShelterName"],
// "Shelter name" would refer to an existing viewfilter.
customFilter: {
// The customFilter represents a viewfilter
// created as part of the REST request.
boolean: 'and',
items: [
{
fieldname: 'status',
operator: '=',
fieldvalue: 'Open'
},
{
fieldname: 'availability',
operator: 'GreaterThan',
fieldvalue: '300'
}
]
}
};
await fetch(`${baseUrl}/board/Shelters/display/List/history/1`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(filteredDataObject)
});
// Get historical data with paging.
await fetch(`${baseUrl}/board/Shelters/display/List/history/1`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-Paging-Page': '1',
'X-Paging-PageSize': '50'
}
});
// Get filtered historical data with paging.
var filteredDataObject = {
viewFilters: ["ShelterName"],
// "Shelter name" would refer to an existing viewfilter.
customFilter: {
// The customFilter represents a viewfilter
// created as part of the REST request.
boolean: 'and',
items: [
{
fieldname: 'status',
operator: '=',
fieldvalue: 'Open'
},
{
fieldname: 'availability',
operator: 'GreaterThan',
fieldvalue: '300'
}
]
}
};
await fetch(`${baseUrl}/board/Shelters/display/List/history/1`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-Paging-Page': '1',
'X-Paging-PageSize': '50'
},
body: JSON.stringify(filteredDataObject)
});
C# Call
Copy Code
// Get all historical data.
public async Task<string> GetHistoricalData()
{
using (var httpClient = new HttpClient(httpClientHandler))
{
var response = await
httpClient.PostAsync($"{baseUrl}/board/Shelters/display/List/history/1");
return await response.Content.ReadAsStringAsync();
}
}
// Get filtered historical data.
public async Task<string> GetFilteredHistoricalData()
{
using (var httpClient = new HttpClient(httpClientHandler))
{
var filteredDataObject = new
{
viewFilters = new string[] { "ShelterName" },
customFilter = new
{
boolean = "and",
items = new object[] {
new {
fieldname="status",
fieldvalue="Open",
@operator="="
}, // The "at sign" is necessary when naming a variable 'operator' in C#
new {
fieldname="availability",
fieldvalue="300",
@operator="GreaterThan"
}
}
}
};
var serializedInformation = JsonConvert.SerializeObject(filteredDataObject);
var response = await httpClient.PostAsync($"{baseUrl}/board/Shelters/display/List/history/1",
new StringContent(serializedInformation, Encoding.UTF8, "application/json"));
return await response.Content.ReadAsStringAsync();
}
}
// Get historical data with paging.
public async Task<string> GetHistoricalDataWithPaging()
{
using (var httpClient = new HttpClient(httpClientHandler))
{
httpClient.DefaultRequestHeaders.Add("X-Paging-Page", page);
httpClient.DefaultRequestHeaders.Add("X-Paging-PageSize",
pageSize);
var response = await
httpClient.PostAsync($"{baseUrl}/board/Shelters/display/List/history/1");
return await response.Content.ReadAsStringAsync();
}
}
// Get filtered historical data with paging.
public async Task<string> GetFilteredHistoricalData()
{
using (var httpClient = new HttpClient(httpClientHandler))
{
httpClient.DefaultRequestHeaders.Add("X-Paging-Page", page);
httpClient.DefaultRequestHeaders.Add("X-Paging-PageSize",
pageSize);
var filteredDataObject = new
{
viewFilters = new string[] { "ShelterName" },
customFilter = new
{
boolean = "and",
items = new object[] {
new {
fieldname="status",
fieldvalue="Open",
@operator="="
}, // The "at sign" is necessary when naming a variable 'operator' in C#
new {
fieldname="availability",
fieldvalue="300",
@operator="GreaterThan"
}
}
}
};
var serializedInformation = JsonConvert.SerializeObject(filteredDataObject);
var response = await
httpClient.PostAsync($"{baseUrl}/board/Shelters/display/List/history/1",
new StringContent(serializedInformation, Encoding.UTF8, "application/json"));
return await response.Content.ReadAsStringAsync();
}
}