Skip to content

List number of resources & resources per page in API response #54

@LMBishop

Description

@LMBishop

When sending a request to paginated endpoints such as listResources and getResourcesByAuthor, there is no way to know how many pages of resources there are without sending another request with a different page number and expecting an empty response (indicating a blank page).

This could be fixed by returning the total number of resources, and the number of resources per page (should this change in the future) in the API response.

Example GET index.php?action=getResourcesByAuthor&id=138900&page=1:

{
  "meta": {
    "total_items": "20",
    "items_per_page": "10"
  },
  "items": [
    {
      "id": "23696",
      "title": "Quests [1.8-1.17] | Set up goals for players",
      "tag": "Allow your players to do quests in return for rewards",
      "etc": "..."
    }
  ]
}

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions