Simplified Declarative API In GoodData.CN 2.0

Hi Community, let us inform our users, mainly those who manage the data model via API, that we in GoodData simplified declarative API In GoodData.CN 2.0. It is no longer necessary to create a “primary label” definition. By design, primary labels will be automatically available in attributes of an entity API (with the same ID).

If you are not using our Logical Data Model (LDM) modeler UI but manage your model manually via API, please ensure that your primary labels and attributes have the same ID. Otherwise, you may find that your dashboard will stop working with messages like:

{
  "status": 400,
  "detail": "An error has occurred during the calculation of the result",
  "resultId": "b61422c23443",
  "reason": "Cannot find label with id='label/label.gooddata.name/28cdfs43dw221134' in LDM"
}

Steps to avoid the mentioned problem

  1. GET /api/v1/entities/workspaces/<id>/labels?filter=primary==true&include=attribute - this will list all primary labels and attributes. You will get a similar response:

    {
      "attributes": {
        "title": "Status",
        "description": "Status id",
        "tags": [
          "Activity"
        ],
        "primary": true,
        "sourceColumn": "ls__status_id__nm_status"
      },
      "id": "incorrect_id_f_activity.status_id",
      "links": {
        "self": "https://mycompany.gooddata.com/api/v1/entities/workspaces/a5c8731be9d54fbdb61f67c6050d5625/labels/f_activity.status_id"
      },
      "relationships": {
        "attribute": {
          "data": {
            "id": "f_activity.status_id",
            "type": "attribute"
          }
        }
      }
    }
    
  2. Change the primary label identifier and its existing references to match the identifier of the related attribute.

  3. PUT this changed model back.

  4. Also, make sure that all attribute IDs and primary labels correspond to the analytical model (dashboards, visualization, and metrics).

    You can check by GET https://mycompany.gooddata.com/api/v1/layout/workspaces//analyticsModel

  5. Change the primary label identifier and its existing references to match the identifier of the related attribute.

  6. PUT this changed model back.

Notes

  • Doing these steps before upgrading to version 2.0 will make the mapping easier. Please also keep in mind that with the 2.0 version, we also have API versioning v1—the older version does not have v1 in the URI.
  • In case you are already on the 2.0 CN version - we recommend using a backup from 1.7 and comparing the ID there. Also, you can modify the backup (change the primary label identifier and its existing references to match with the identifier of the related attribute) and PUT this modified backup to 2.0.

If you are interested in GoodData.CN, please contact us.

Alternatively, test a trial version of GoodData Cloud:

Start Your GoodData Analytics Trial — Commitment-Free