API: get all lists
This commit is contained in:
parent
ae7a8eb72d
commit
5f18c9d44f
2 changed files with 35 additions and 0 deletions
|
@ -348,6 +348,22 @@ router.get('/subscriptions/:listId', (req, res) => {
|
|||
});
|
||||
});
|
||||
|
||||
router.get('/lists', (req, res) => {
|
||||
lists.quicklist((err, lists) => {
|
||||
if (err) {
|
||||
res.status(500);
|
||||
return res.json({
|
||||
error: err.message || err,
|
||||
data: []
|
||||
});
|
||||
}
|
||||
res.status(200);
|
||||
res.json({
|
||||
data: lists
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
router.get('/lists/:email', (req, res) => {
|
||||
lists.getListsWithEmail(req.params.email, (err, lists) => {
|
||||
if (err) {
|
||||
|
|
|
@ -296,3 +296,22 @@
|
|||
</p>
|
||||
|
||||
<pre>curl -XGET '{{serviceUrl}}api/lists/test@example.com?access_token={{accessToken}} </pre>
|
||||
|
||||
<h3>GET /api/lists – {{#translate}}Get all lists{{/translate}}</h3>
|
||||
|
||||
<p>
|
||||
{{#translate}}Retrieve every list. {{/translate}}
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong>GET</strong> {{#translate}}arguments{{/translate}}
|
||||
</p>
|
||||
<ul>
|
||||
<li><strong>access_token</strong> – {{#translate}}your personal access token{{/translate}}
|
||||
</ul>
|
||||
|
||||
<p>
|
||||
<strong>{{#translate}}Example{{/translate}}</strong>
|
||||
</p>
|
||||
|
||||
<pre>curl -XGET '{{serviceUrl}}api/lists?access_token={{accessToken}}'</pre>
|
Loading…
Add table
Add a link
Reference in a new issue