Added API documentation on how to update a card. For API URL /api/boards/:boardId/lists/:fromListId/cards/:cardId

Thor Berggren 2018-04-10 14:52:10 -07:00
parent 89aee7d0a3
commit a931c7f2ed

@ -44,6 +44,7 @@ When calling a production Wekan server, ensure it is running via HTTPS and has a
| HTTP Method | Url | Short Description |
| :--- | :--- | :--- |
| `POST` | `/api/boards/:boardId/lists/:listId/cards` | [Add a card to a list, board, and swimlane.](#add-card-to-list-board-swimlane) |
| `PUT` | `/api/boards/:boardId/lists/:fromListId/cards/:cardId` | [Update a card.](#update-a-card) |
---
@ -464,7 +465,7 @@ curl -H "Authorization: Bearer t7iYB86mXoLfP_XsMegxF41oKT7iiA9lDYiKVtXcctl" \
# Add Card to List-Board-Swimlane
| URL / Code Link | Requires Admin Auth | HTTP Method |
| API 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` |
@ -480,4 +481,27 @@ The new card's ID is returned in the format:
```json
{
"_id": "W9m9YxQKT6zZrKzRW"
}
}
```
# Update a card
You can change (any of) the card's title, list, and description.
| API URL / Code Link | Requires Admin Auth | HTTP Method |
| :--- | :--- | :--- |
| [/api/boards/:boardId/lists/:fromListId/cards/:cardId](https://github.com/wekan/wekan/blob/c115046a7c86b30ab5deb8762d3ef7a5ea3f4f90/models/cards.js#L520) | `yes` | `PUT` |
```shell
curl -H "Authorization: Bearer t7iYB86mXoLfP_XsMegxF41oKT7iiA9lDYiKVtXcctl" \
-H "Content-type:application/json" \
-X PUT \
http://localhost:3000/api/boards/YRgy7Ku6uLFv2pYwZ/lists/PgTuf6sFJsaxto5dC/cards:cardId \
-d '{ "title": "New title text", "listId": "New destination listId", "description": "New description text" }'
```
## Result example
The card's ID is returned in the format:
```json
{
"_id": "W9m9YxQKT6zZrKzRW"
}
```