I need to add a TextCard to an already created dashboard using the Metabase API. According to the documentation I could use PUT /api/dashboard/:id/cards with this body:
{:cards [{:id ...
:sizeX ...
:sizeY ...
:row ...
:col ...
:series [{:id 123
...}]} ...]}
So far I’ve tried this with the Metabase Python library:
payload = {
"id": new_dashboard_id,
"cards": [{
"row": 0,
"col": 0,
"sizeX": 5,
"sizeY": 2,
"parameter_mappings": [],
"visualization_settings": {
"virtual_card": {
"display": "text",
"visualization_settings": {},
"dataset_query": {},
},
"text.align_vertical": "middle",
"text.align_horizontal": "center",
"text": "Sample text"
}
}]
}
metabase.put('/dashboard/10/cards', json=payload)
I’ve also tried using POST and dashboard-card removing the [ ] part of cards, with no avail. At most I get a blank rectangle with the keys symbol (no permission to see the card)
Any clues on the correct syntax for achieving this?
Thanks!
Rodrigo