Having issues importing simple text-box of a dashboard with "api/dashboard"?

While creating a dashboard in metabase with api/dashboard, simple textbox is not getting created with JSON data.
I am using metabase version: v0.41.3.1 and JDK version: 1.6.0.

Step 1: I created the dashboard on Metabase.
Step 2: Then i added a simple text box with some context in the same dashboard.
Step 3: I exported that dashboard with text box with api/dashboard/:id.
Step 4: I am trying to create new dashboard with the same exported data with api/dashboard.
Step 4: Dashboard created with no simple-text-box context in it.

Is there any way to import simple/dynamic text-box with/without importing dashboard?

Thanks in advance!

Hi @shubham-yadav
You should upgrade immediately to a newer release, and upgrade to Java 11.
I'm not sure I understand what you mean by import. A textbox is similar to other cards, though without a question reference.
The best way to learn the API, is to just use Metabase while having your browser developer Network-tab open and looking at the request, and what data is being send/received.

Hi @flamber,
Thank you for a quick response, but i cannot upgrade the JAVA version at the moment.

What i mean by import is, if i used below Object as my payload in my api api/dashboard with POST request, then only dashboard will be created in my running metabase, even though this Object consist the card Object of simple-text-box.

Payload Object:

{
  "description": null,
  "archived": false,
  "collection_position": null,
  "ordered_cards": [
    {
      "sizeX": 4,
      "series": [],
      "collection_authority_level": null,
      "card": {
        "query_average_duration": null
      },
      "updated_at": "2022-11-02T14:28:21.701",
      "col": 0,
      "id": 1,
      "parameter_mappings": [],
      "card_id": null,
      "visualization_settings": {
        "virtual_card": {
          "name": null,
          "display": "text",
          "visualization_settings": {},
          "dataset_query": {},
          "archived": false
        },
        "text": "Testing Text!"
      },
      "dashboard_id": 1,
      "created_at": "2022-11-02T14:27:55.773",
      "sizeY": 1,
      "row": 0
    }
  ],
  "param_values": null,
  "can_write": true,
  "enable_embedding": false,
  "collection_id": 2,
  "show_in_getting_started": false,
  "name": "Testing Dashboard",
  "caveats": null,
  "collection_authority_level": null,
  "creator_id": 1,
  "updated_at": "2022-11-02T14:28:21.748",
  "made_public_by_id": null,
  "embedding_params": null,
  "cache_ttl": null,
  "id": 1,
  "position": null,
  "param_fields": null,
  "last-edit-info": {
    "id": 1,
    "email": "shubhamyadav@credenceanalytics.com",
    "first_name": "Shubham",
    "last_name": "yadav",
    "timestamp": "2022-11-02T14:28:21.76"
  },
  "parameters": [],
  "created_at": "2022-11-02T14:26:35.662",
  "public_uuid": null,
  "points_of_interest": null
}

@shubham-yadav
Metabase has never supported Java 6, have no idea how it's working for you, but you need to upgrade your systems immediately. They are vulnerable to many critical security problems like Log4j.

You need to insert the textbox into a dashboard. Have a look in your browser developer console, you'll see a request to POST /api/dashboard/:id/cards and then there's PUT /api/dashboard/:id

If you just want to duplicate a dashboard, then you can do that: https://www.metabase.com/docs/latest/api/dashboard#post-apidashboardfrom-dashboard-idcopy

1 Like

Hi @flamber,
Thanks for the solutions.

In my problem POST /api/dashboard/:id/cards this one works!