{"action":"closed","issue":{"url":"https://api.github.com/repos/cachethq/Cachet/issues/756","labels_url":"https://api.github.com/repos/cachethq/Cachet/issues/756/labels{/name}","comments_url":"https://api.github.com/repos/cachethq/Cachet/issues/756/comments","events_url":"https://api.github.com/repos/cachethq/Cachet/issues/756/events","html_url":"https://github.com/cachethq/Cachet/issues/756","id":90108243,"number":756,"title":"feature: better incident search api","user":{"login":"blaskovicz","id":10687433,"avatar_url":"https://avatars.githubusercontent.com/u/10687433?v=3","gravatar_id":"","url":"https://api.github.com/users/blaskovicz","html_url":"https://github.com/blaskovicz","followers_url":"https://api.github.com/users/blaskovicz/followers","following_url":"https://api.github.com/users/blaskovicz/following{/other_user}","gists_url":"https://api.github.com/users/blaskovicz/gists{/gist_id}","starred_url":"https://api.github.com/users/blaskovicz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blaskovicz/subscriptions","organizations_url":"https://api.github.com/users/blaskovicz/orgs","repos_url":"https://api.github.com/users/blaskovicz/repos","events_url":"https://api.github.com/users/blaskovicz/events{/privacy}","received_events_url":"https://api.github.com/users/blaskovicz/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":{"login":"GrahamCampbell","id":2829600,"avatar_url":"https://avatars.githubusercontent.com/u/2829600?v=3","gravatar_id":"","url":"https://api.github.com/users/GrahamCampbell","html_url":"https://github.com/GrahamCampbell","followers_url":"https://api.github.com/users/GrahamCampbell/followers","following_url":"https://api.github.com/users/GrahamCampbell/following{/other_user}","gists_url":"https://api.github.com/users/GrahamCampbell/gists{/gist_id}","starred_url":"https://api.github.com/users/GrahamCampbell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GrahamCampbell/subscriptions","organizations_url":"https://api.github.com/users/GrahamCampbell/orgs","repos_url":"https://api.github.com/users/GrahamCampbell/repos","events_url":"https://api.github.com/users/GrahamCampbell/events{/privacy}","received_events_url":"https://api.github.com/users/GrahamCampbell/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/cachethq/Cachet/milestones/8","html_url":"https://github.com/cachethq/Cachet/milestones/V1.2.0","labels_url":"https://api.github.com/repos/cachethq/Cachet/milestones/8/labels","id":1237193,"number":8,"title":"V1.2.0","description":"","creator":{"login":"GrahamCampbell","id":2829600,"avatar_url":"https://avatars.githubusercontent.com/u/2829600?v=3","gravatar_id":"","url":"https://api.github.com/users/GrahamCampbell","html_url":"https://github.com/GrahamCampbell","followers_url":"https://api.github.com/users/GrahamCampbell/followers","following_url":"https://api.github.com/users/GrahamCampbell/following{/other_user}","gists_url":"https://api.github.com/users/GrahamCampbell/gists{/gist_id}","starred_url":"https://api.github.com/users/GrahamCampbell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GrahamCampbell/subscriptions","organizations_url":"https://api.github.com/users/GrahamCampbell/orgs","repos_url":"https://api.github.com/users/GrahamCampbell/repos","events_url":"https://api.github.com/users/GrahamCampbell/events{/privacy}","received_events_url":"https://api.github.com/users/GrahamCampbell/received_events","type":"User","site_admin":false},"open_issues":0,"closed_issues":14,"state":"open","created_at":"2015-08-02T21:01:05Z","updated_at":"2015-08-08T13:34:15Z","due_on":"2015-08-07T23:00:00Z","closed_at":null},"comments":16,"created_at":"2015-06-22T14:09:28Z","updated_at":"2015-08-08T13:34:15Z","closed_at":"2015-08-08T13:34:15Z","body":"Looking at the [api docs](https://docs.cachethq.io/v1.0/docs/get-incidents) and [the code](https://github.com/cachethq/Cachet/blob/master/app/Http/Controllers/Api/IncidentController.php#L33) for incidents, I can't seem to find a way to allow sorting incidents via `GET /api/v1/incidents` (they default to being sorted by id, ascending). Along with this, the incidents are paginated by `(total rows / num per page) = num pages`.\r\n\r\nMy use case is that I would like to be able to get the most recent incidents that I haven't yet processed with my poller (ie, those I haven't seen and need to post to our slack channel).\r\n\r\nA few solutions:\r\n* allow adding incident id range to the api for `/incidents` instead of page number. This would allow pagination by already seen ids.\r\n* allow sorting incidents by `id DESC`. This would allow me to at least ask for the most recent incidents and work my way backwards.\r\n* add configurable webhooks that allow my site to be triggered on new incident creation. This is the most flexible and would have a lot of benefit for other sites that want the data \"in real time.\""}}