You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@gnilebein As far as I know, the Rest API endpoints did not change. Please share system info and error messages.
Thank you very much for your answer.. I was able to solve the problem myself by adapting my script. I have used this script in the past to move overdue cards from one stack to another.
<?php// Dieses Script verschiebt Karten aus einem Stack "Warten" in einen anderen Stack, wenn das DueDate überschritten wurde.// Es unterstützt mehrere Boards.$boards = [
["id" => 6, "source" => 20, "destination" => 10]
];
$username = "USER";
$password = "PASSWORD";
// Funktion zum Senden von cURL-RequestsfunctionsendCurlRequest($url, $method = "GET", $data = null)
{
global$username, $password;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
curl_setopt($ch, CURLOPT_TIMEOUT, 5);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Content-Type: application/json',
'OCS-APIRequest: true',
'Authorization: Basic ' . base64_encode($username . ":" . $password)
]);
if ($method !== "GET") {
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
if ($data !== null) {
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
}
}
$response = curl_exec($ch);
if ($response === false) {
error_log("cURL-Fehler: " . curl_error($ch));
}
curl_close($ch);
returnjson_decode($response, true);
}
foreach ($boardsas$board) {
$url = "https://nextcloud.gnilebein.de/index.php/apps/deck/api/v1.1/boards/{$board['id']}/stacks/{$board['source']}";
$cards = sendCurlRequest($url);
if (!isset($cards['cards'])) {
error_log("Fehler: Keine Karten gefunden für Board ID {$board['id']}");
continue;
}
$data = ["order" => 0, "stackId" => $board['destination']];
foreach ($cards['cards'] as$card) {
if ($card['overdue'] > 1) {
$moveUrl = "https://nextcloud.domain.tld/index.php/apps/deck/api/v1.1/boards/{$board['id']}/stacks/{$card['stackId']}/cards/{$card['id']}/reorder";
sendCurlRequest($moveUrl, "PUT", $data);
}
}
}
So far it has worked to update the order and destination fields for the card. With this code, moving works again:
foreach ($boardsas$board) {
$url = "https://nextcloud.gnilebein.de/index.php/apps/deck/api/v1.1/boards/{$board['id']}/stacks/{$board['source']}";
$cards = sendCurlRequest($url);
if (!isset($cards['cards'])) {
error_log("Fehler: Keine Karten gefunden für Board ID {$board['id']}");
continue;
}
foreach ($cards['cards'] as$card) {
if ($card['overdue'] > 1) {
$card['order'] = 999;
$card['stackId'] = $board['destination'];
$moveUrl = "https://nextcloud.domain.tld/index.php/apps/deck/api/v1.1/boards/{$board['id']}/stacks/{$card['stackId']}/cards/{$card['id']}/reorder";
sendCurlRequest($moveUrl, "PUT", $card);
}
}
}
I can confirm that the behavior of the API has changed after updating Deck.
Currently I am running Nextcloud 31.0.6 with Deck version 1.15.1.
I am also using the REST API to move cards. Before updating Deck (or NC respectively) moving Cards worked fine.
Now I still get a "200 Success" response, but the card stays at its position.
@gnilebein
Can you please explain, what you changed in your code? I think I roughly understand what you did, but am not that familiar with PHP.
Mainly you are now passing indivual objects of each card to the CurlRequest instead of the common data object and you changed the order from 0 to 999. Am I missing something?
I just updated to Deck version 1.15.2. The issue is still active.
Does anybody have an idea for a workaround? Currently I am unable to use the API properly as this is a major feature of Deck.
I am on deck v 1.15.2 as well and reordering is still working with no changes on our end.
However, we are just creating a new card in the stack and then reordering it to the top in the same stack (order=0). We are not moving it to a different stack.
I am on deck v 1.15.2 as well and reordering is still working with no changes on our end.
However, we are just creating a new card in the stack and then reordering it to the top in the same stack (order=0). We are not moving it to a different stack.
Maybe that is where the issue is?
Sorry, I was a little imprecise.
Yes, I want to move cards from one stack to another. I did not try to move cards within a stack, yet.
The reorder-API for cards via REST is broken, as a workaround we simply used the /cards/{cardId}/reorder endpoint that the native client also uses. I have put up a PR that should fix the REST endpoint, too.
I just checked, and the fixes from #7154 and friends have not resolved this issue.
I run the latest beta, and even verified in the source that the changes from #7276 is applied.
I still get a 200-response, but the card is NOT moved to another stack when I use the path /apps/deck/api/v1.1/boards/{board_id}/stacks/{stack_id}/cards/{card_id}/reorder
I have tested with both the minimal parameters specified in the docs:
{
stackId: <new id>,
order: 1234,
}
And with the full card-config (but changing to the new stackId obviousy)
Sending the entire card-config (with the new stackId) to the endpoint /apps/deck/cards/{card_id}/reorder moves the card to the new stack as expected.
I just checked, and the fixes from #7154 and friends have not resolved this issue. I run the latest beta, and even verified in the source that the changes from #7276 is applied.
I still get a 200-response, but the card is NOT moved to another stack when I use the path /apps/deck/api/v1.1/boards/{board_id}/stacks/{stack_id}/cards/{card_id}/reorder
I have tested with both the minimal parameters specified in the docs:
{
stackId: <new id>,
order: 1234,
}
And with the full card-config (but changing to the new stackId obviousy)
Sending the entire card-config (with the new stackId) to the endpoint /apps/deck/cards/{card_id}/reorder moves the card to the new stack as expected.
I have same problem with you,
Tried many method and didnt works
Please fix this or document it effectively. I wasted hours just trying to move a card.
CardApiController::reorder() and CardController::reorder() both delegate to the same CardService::reorder(), so they behave identically.
A side effect worth knowing about either way:reorder rewrites lastModified on every card in the target stack, not just the moved one. CardService::reorder() does $this->cardMapper->findAll($stackId) and writes each card back through CardMapper::update(), whose $updateModified parameter defaults to true and therefore calls setLastModified(time()) on all of them.
Measured on a real board: moving a single card into a stack of 32 rewrote lastModified on all 32, including cards created years earlier and untouched since. That makes lastModified unusable for "when did this card last actually change".
An alternative that avoids it: a card can be moved with the ordinary documented update endpoint by addressing it at the target stack, since CardService::update() takes stackId and sets it without touching any other card:
PUT /index.php/apps/deck/api/v1.0/boards/{boardId}/stacks/{TARGET_STACK_ID}/cards/{cardId}
Same board, same card, moving into that 32-card stack: the card moved, order was honoured, and zero of the other 32 cards had lastModified rewritten.
One caveat if you try this.CardService::update() declares description = '', duedate = null and friends as defaulted parameters, so anything you omit is overwritten rather than left alone. A minimal payload of title/type/owner moved the card correctly but blanked its description and due date. Resending the card's full current state preserved everything. So this is only a safe substitute for reorder if you round-trip the whole card.
Activity
luka-nextcloud commentedon Mar 19, 2025
@gnilebein As far as I know, the Rest API endpoints did not change. Please share system info and error messages.
gnilebein commentedon Mar 19, 2025
Thank you very much for your answer.. I was able to solve the problem myself by adapting my script. I have used this script in the past to move overdue cards from one stack to another.
So far it has worked to update the order and destination fields for the card. With this code, moving works again:
user8446 commentedon Mar 20, 2025
Hi you mentioned it changed with the "current version". Did you update to NC 31 which upgrades deck to 1.15.0?
I use that API as well and want to be on the lookout for it.
nikhub commentedon Jul 7, 2025
I can confirm that the behavior of the API has changed after updating Deck.
Currently I am running Nextcloud 31.0.6 with Deck version 1.15.1.
I am also using the REST API to move cards. Before updating Deck (or NC respectively) moving Cards worked fine.
Now I still get a "200 Success" response, but the card stays at its position.
@gnilebein
Can you please explain, what you changed in your code? I think I roughly understand what you did, but am not that familiar with PHP.
Mainly you are now passing indivual objects of each card to the CurlRequest instead of the common data object and you changed the order from 0 to 999. Am I missing something?
nikhub commentedon Jul 31, 2025
I just updated to Deck version 1.15.2. The issue is still active.
Does anybody have an idea for a workaround? Currently I am unable to use the API properly as this is a major feature of Deck.
user8446 commentedon Aug 1, 2025
I am on deck v 1.15.2 as well and reordering is still working with no changes on our end.
However, we are just creating a new card in the stack and then reordering it to the top in the same stack (order=0). We are not moving it to a different stack.
Maybe that is where the issue is?
nikhub commentedon Aug 3, 2025
Sorry, I was a little imprecise.
Yes, I want to move cards from one stack to another. I did not try to move cards within a stack, yet.
vdiezel commentedon Aug 5, 2025
The reorder-API for cards via REST is broken, as a workaround we simply used the /cards/{cardId}/reorder endpoint that the native client also uses. I have put up a PR that should fix the REST endpoint, too.
Olen commentedon Nov 25, 2025
I just checked, and the fixes from #7154 and friends have not resolved this issue.
I run the latest beta, and even verified in the source that the changes from #7276 is applied.
I still get a 200-response, but the card is NOT moved to another stack when I use the path
/apps/deck/api/v1.1/boards/{board_id}/stacks/{stack_id}/cards/{card_id}/reorderI have tested with both the minimal parameters specified in the docs:
And with the full card-config (but changing to the new stackId obviousy)
Sending the entire card-config (with the new stackId) to the endpoint
/apps/deck/cards/{card_id}/reordermoves the card to the new stack as expected.aikusuma commentedon Dec 9, 2025
I have same problem with you,
Tried many method and didnt works
Please fix this or document it effectively. I wasted hours just trying to move a card.
Olen commentedon Aug 3, 2026
Some findings from digging into this on Deck 1.17.3, in case they help.
Both reorder routes still exist, so the documented one has not been removed:
CardApiController::reorder()andCardController::reorder()both delegate to the sameCardService::reorder(), so they behave identically.A side effect worth knowing about either way:
reorderrewriteslastModifiedon every card in the target stack, not just the moved one.CardService::reorder()does$this->cardMapper->findAll($stackId)and writes each card back throughCardMapper::update(), whose$updateModifiedparameter defaults totrueand therefore callssetLastModified(time())on all of them.Measured on a real board: moving a single card into a stack of 32 rewrote
lastModifiedon all 32, including cards created years earlier and untouched since. That makeslastModifiedunusable for "when did this card last actually change".An alternative that avoids it: a card can be moved with the ordinary documented update endpoint by addressing it at the target stack, since
CardService::update()takesstackIdand sets it without touching any other card:Same board, same card, moving into that 32-card stack: the card moved,
orderwas honoured, and zero of the other 32 cards hadlastModifiedrewritten.One caveat if you try this.
CardService::update()declaresdescription = '',duedate = nulland friends as defaulted parameters, so anything you omit is overwritten rather than left alone. A minimal payload oftitle/type/ownermoved the card correctly but blanked its description and due date. Resending the card's full current state preserved everything. So this is only a safe substitute forreorderif you round-trip the whole card.