Merge pull request #3745 from atom/document-apm-sort

Document sort params on atom.io package list
This commit is contained in:
Kevin Sawicki 2014-11-20 13:21:43 -08:00
commit 1e4e59ad1c

View File

@ -30,6 +30,8 @@ All requests that take parameters require `application/json`.
Parameters:
- **page** (optional)
- **sort** (optional, values: `created_at`, `updated_at`, `downloads`)
- **direction** (optional, values: `asc`, `desc`)
Returns a list of all packages in the following format:
```json
@ -57,6 +59,20 @@ Link: <https://www.atom.io/api/packages?page=1>; rel="self",
<https://www.atom.io/api/packages?page=2>; rel="next"
```
By default, results are sorted by download count, descending.
#### GET /api/packages/search
Parameters:
- **q** String query to search
- **sort** (optional, values: `created_at`, `updated_at`, `downloads`)
- **direction** (optional, values: `asc`, `desc`)
Returns a list of all packages in the same format as `/api/packages`.
By default, results sorted by relevance to search query.
### Showing package details
#### GET /api/packages/:package_name