From bdb367ffb9708dd6175541a7f95c14f24c4262de Mon Sep 17 00:00:00 2001 From: Thor Berggren Date: Sat, 7 Apr 2018 13:14:01 -0700 Subject: [PATCH] Added API documentation on how to add a card to list-board-swimlane. URL /api/boards/:boardId/lists/:listId/cards --- REST-API.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/REST-API.md b/REST-API.md index 733b875..7cb366a 100644 --- a/REST-API.md +++ b/REST-API.md @@ -40,6 +40,7 @@ When calling a production Wekan server, ensure it is running via HTTPS and has a | `GET` | `/api/users/:id` | [Gets a user's information.](#user-information) | | `GET` | `/api/users` | [All of the users.](#user-list) | | `GET` | `/api/user` | [Gets a logged-in user.](#user-logged-in) | +| `POST` | `/api/boards/:boardId/lists/:listId/cards` | [Add a card to a list, board, and swimlane.](#add-card-to-list-board-swimlane) | --- @@ -457,3 +458,23 @@ curl -H "Authorization: Bearer t7iYB86mXoLfP_XsMegxF41oKT7iiA9lDYiKVtXcctl" \ http://localhost:3000/api/users/ztKvBTzCqmyJ77on8 \ -d '{ "action": "takeOwnership" }' ``` + +# Add Card to List-Board-Swimlane + +| URL / Code Link | Requires Admin Auth | HTTP Method | +| :--- | :--- | :--- | +| [/api/boards/:boardId/lists/:listId/cards](https://github.com/wekan/wekan/blob/c115046a7c86b30ab5deb8762d3ef7a5ea3f4f90/models/cards.js#L487) | `yes` | `POST` | + +```shell +curl -H "Authorization: Bearer t7iYB86mXoLfP_XsMegxF41oKT7iiA9lDYiKVtXcctl" \ + -H "Content-type:application/json" \ + -X POST \ + http://localhost:3000/api/boards/YRgy7Ku6uLFv2pYwZ/lists/PgTuf6sFJsaxto5dC/cards \ + -d '{ "title": "Card title text", "description": "Card description text", "authorId": "The appropriate existing userId", "swimlaneId": "The destination swimlaneId" }' +``` +## Result example +The new card's ID is returned in the format: +```json +{ + "_id": "W9m9YxQKT6zZrKzRW" +} \ No newline at end of file