Tutorial

Simplified declarative API In GoodData.CN 2.0

  • 12 August 2022
  • 0 replies
  • 37 views

Userlevel 1

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 you all primary labels and attributes. You will get 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 with the identifier of the related attribute.
  3. PUT this changed model back.
  4. Also make sure that all ID for attributes and primary labels are corresponding with the analytical model (dashboards, visualization, and metrics).

    You can check by GET 
    https://mycompany.gooddata.com/api/v1/layout/workspaces/<workspaceId>/analyticsModel
     
  5. Change the primary label identifier and its existing references to match with 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.
  • Also please keep in mind that with 2.0 version we also have api versioning v1 - older version is without v1 in uri.
  • In case you are already on 2.0 CN version - we recommend to use backup from 1.7 and compare 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


This topic has been closed for comments