Take
Data can be retrieved in chunks by specifying how many items to retrieve:
/api/[entity]?take=[take]
Skip
In order to take items from 11 to 20 a skip query needs to be specified:
/api/[entity]?take=[take]&skip=[skip]
Response
When paging, the default Response Data field get extended by an additional attribute Count. Count gives you a total number of all the available items for a query.
The following is a JSON format of the response:
{
Success: bool,
ErrorMessage: string,
Data: {
Data: Array<object>,
Count: int
}
}
Example
The following example is in javascript, using jQuery:
function getData(){
$.ajax({
type: "GET",
url: 'https://[subdomain].manageworkonline.com/awt/api/[entity]?take=10&skip=10',
crossDomain: true,
xhrFields: { withCredentials: true },
success: function(response){
if(response.Success){
alert(response.Data.Data.length
+ " out of " + response.Data.Count
+ " items returned");
} else {
alert(response.ErrorMessage);
}
},
dataType: "json"
});
}
For further information view Entities
Post your comment on this topic.