1

Using Element API I would like to remove the limit to how many entries are in the JSON output.

The default is 100 entries, with pagination. I would like 1 response with all entries.

Here is my current call:

return [
'endpoints' => [
    'fullmembers.json' => [
        'elementType' => 'User',
        'criteria' => ['group' => 'fullMembership'],
        'transformer' => function(UserModel $member) {
//....

Thanks in advance guys!

1 Answer 1

5

You have to set the criteria model's limit parameter to null and disable pagination.

'criteria' => [
    'group' => 'fullMembership',
    'limit' => null,
],
'paginate' => false,
2
  • Thanks Carlcs, but that still results in this: {"pagination":{"total":409,"count":100,"per_page":100,"current_page":1,"total_pages":5,"links":{"next":"http:\/\/craft.fira\/fullmembers.json?page=2"}}}} Commented Jan 29, 2016 at 11:48
  • Oh, you have to disable pagination. Will update the answer.
    – carlcs
    Commented Jan 29, 2016 at 11:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.