I am using the block of text below to pull data points from a variable between two dates. All this works perfectly until my request requires more than 50 data points. Is there some setting to allow more datapoints to be downloaded at once?
Code snippet (JavaScript / jQuery):
// Get details of each variable
function getDetails(url) {
$.ajax({
url: url,
data: { “token”: user_token, “start”: start_date, “end”: end_date }
}).done(function (data) {
data.results.forEach(function (data) {
dataCounts.unshift(data.value); // Since we get the values last in / first out
dataTimes.unshift(new Date(data.created_at));
});
That does sounds like the right command but, I am not sure how to implement it. Here is what I am doing:
// Request trail count data from Ubidots - looking for People
function getVariables(url) {
$.ajax({
url: url,
data: { “token”: user_token }
}).done(function (data) {
var variables = data.results;
variables.forEach(function (variable) {
if (variable.name == “People”) {
setPagination(variable.values_url);
getDetails(variable.values_url);
}
});
});
}
// Set the pagination to 1000
function setPagination(url) {
var paginationUrl = url + “/?page_size=1000”;
console.log(paginationUrl);
$.ajax({
url: paginationUrl,
data: { “token”: user_token}
}).done();
}
Woakas, To the rescue again. I added this to the getVariables function and was able to get all the datapoints I needed. Someday, when I am not so busy trying to get something to work, I need to study that whole CURL to Ajax thing. Thanks again!