Card Labels Empty for API Card Requests #266

Closed
opened 2026-02-04 18:13:59 +03:00 by OVERLORD · 2 comments
Owner

Originally created by @CollierKing on GitHub (Jan 2, 2023).

Hello, it does not seem like you can retrieve labels for a given card, the cardLabels array is empty in the API response, while the card has labels populated in the UI.

Related to #310

image

r = requests.get( "http://localhost:3001/api/cards/12345", headers=headers )

{
  'item': {
    'id': '12345',
    'createdAt': '2023-01-02T16:50:25.000Z',
    'updatedAt': '2023-01-02T17:21:18.000Z',
    'position': 65535,
    'name': 'test',
    'description': 'test desc',
    'dueDate': None,
    'timer': None,
    'boardId': 'abc',
    'listId': 'abc',
    'creatorUserId': 'abc',
    'coverAttachmentId': None,
    'isSubscribed': False
  },
  'included': {
    'cardMemberships': [],
    'cardLabels': [],
    'tasks': [
      {
        'id': '12345',
        'createdAt': '2023-01-02T17:21:22.000Z',
        'updatedAt': None,
        'position': 65535,
        'name': 'test test task',
        'isCompleted': False,
        'cardId': '12345'
      }
    ],
    'attachments': []
  }
}
Originally created by @CollierKing on GitHub (Jan 2, 2023). Hello, it does not seem like you can retrieve labels for a given card, the `cardLabels` array is empty in the API response, while the card has labels populated in the UI. Related to #310 ![image](https://user-images.githubusercontent.com/10591022/210262905-e451aee5-4fb4-4fc6-97b2-5fd82a0dd66a.png) ` r = requests.get( "http://localhost:3001/api/cards/12345", headers=headers ) ` ``` { 'item': { 'id': '12345', 'createdAt': '2023-01-02T16:50:25.000Z', 'updatedAt': '2023-01-02T17:21:18.000Z', 'position': 65535, 'name': 'test', 'description': 'test desc', 'dueDate': None, 'timer': None, 'boardId': 'abc', 'listId': 'abc', 'creatorUserId': 'abc', 'coverAttachmentId': None, 'isSubscribed': False }, 'included': { 'cardMemberships': [], 'cardLabels': [], 'tasks': [ { 'id': '12345', 'createdAt': '2023-01-02T17:21:22.000Z', 'updatedAt': None, 'position': 65535, 'name': 'test test task', 'isCompleted': False, 'cardId': '12345' } ], 'attachments': [] } } ```
Author
Owner

@meltyshev commented on GitHub (Jan 3, 2023):

Hello and Happy New Year 🎉
All labels can be retrieved via GET /api/boards/:id and included > labels will contain all labels on the board (which you see in the popup). You don't have a label selected in your card, if you click on it, it will apply to the card and its id will be in included -> cardLabels.

@meltyshev commented on GitHub (Jan 3, 2023): Hello and Happy New Year 🎉 All labels can be retrieved via `GET /api/boards/:id` and `included > labels` will contain all labels on the board (which you see in the popup). You don't have a label selected in your card, if you click on it, it will apply to the card and its id will be in `included -> cardLabels`.
Author
Owner

@CollierKing commented on GitHub (Jan 3, 2023):

Ah very good! it was user error, not saving it to the card. Loving Planka and looking forward to using A LOT in the New Year. Happy New Year to you as well!

@CollierKing commented on GitHub (Jan 3, 2023): Ah very good! it was user error, not saving it to the card. Loving Planka and looking forward to using A LOT in the New Year. Happy New Year to you as well!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/planka#266