API: get list by id
This commit is contained in:
parent
5f18c9d44f
commit
60adfed0a6
2 changed files with 35 additions and 1 deletions
|
@ -364,6 +364,21 @@ router.get('/lists', (req, res) => {
|
|||
});
|
||||
});
|
||||
|
||||
router.get('/list/:id', (req, res) => {
|
||||
lists.get(req.params.id, (err, list) => {
|
||||
if (err) {
|
||||
res.status(500);
|
||||
return res.json({
|
||||
error: err.message || err,
|
||||
});
|
||||
}
|
||||
res.status(200);
|
||||
res.json({
|
||||
data: list
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
router.get('/lists/:email', (req, res) => {
|
||||
lists.getListsWithEmail(req.params.email, (err, lists) => {
|
||||
if (err) {
|
||||
|
|
|
@ -314,4 +314,23 @@
|
|||
<strong>{{#translate}}Example{{/translate}}</strong>
|
||||
</p>
|
||||
|
||||
<pre>curl -XGET '{{serviceUrl}}api/lists?access_token={{accessToken}}'</pre>
|
||||
<pre>curl -XGET '{{serviceUrl}}api/lists?access_token={{accessToken}}'</pre>
|
||||
|
||||
<h3>GET /api/list/:id – {{#translate}}Get list by id{{/translate}}</h3>
|
||||
|
||||
<p>
|
||||
{{#translate}}Retrieve the list with :id {{/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/list/1?access_token={{accessToken}}'</pre>
|
Loading…
Reference in a new issue