Hi Team, I had a small question about how the Get ...
# gooddata-cloud
m
Hi Team, I had a small question about how the Get visualization API works, since I am having an issue with it. When a visualization that has data labels enabled, is retrieved using the API and is then posted to another workspace for example, the labels don't show. What am I missing here? It seems like the API retrieves the visualization with this setting?
m
Hi Maria, I would like to ask, to be on the same page, are you referring the API call mentioned in here?
GET {{baseUrl}}/v1/entities/workspaces/{workspaceId}/visualizationObjects
If not could you please let us to know which endpoint are you using? And, to understand better. Also, when you said 'then is posted to another workspace' can you please clarified how you 'post it' to the another workspace, which endpoint?
m
I used this endpoint to get the visualization object:
{{baseUrl}}/api/v1/entities/workspaces/:workspaceId/visualizationObjects/:objectId
And this to post it:
{{baseUrl}}/api/v1/entities/workspaces/:workspaceId/visualizationObjects
m
Hi Maria, I've tested this and I can confirm that the data label configuration should be preserved as long as it is enabled either in the code or via the UI. Note that when enabled via the UI, this is how it would look like (see screenshot) and in the object definition:
Copy code
"properties": {
          "controls": {
            "dataLabels": {
              "visible": true
            },
            "xaxis": {
              "visible": true
            }
          }
If done via the UI, you will need to save the changes so it is reflected in the code.
m
Hi Maria, I am just wondering if you had the chance to see the last update of my colleague Moises. Please, let us to know if you still need our assistance.
m
Hi Mauricio, Yes, I did have a look at it- the issue persists though
j
Hello Maria, could you please send a screenshot of your object definition. Just like the one Moises had provided above.
m
Hi Maria, this is a follow-up. We would like to investigate further, but we need the information about the object. Could you please share a direct link or the object ID with the Workspace?
m
@Mauricio Cabezas I will dm you the link
m
Hi Maria, thank you for sharing the workspace and insight details. We have checked the insight you sent us, and its values, including the "Show data labels" setting, appear correctly both in the API response and on the UI. Additionally, we've conducted tests on our end by POSTing insights from one workspace to another, using various visualisation types and even including filters. In all our tests, the "Show data labels" setting consistently transferred as expected to the code (API) and UI. To help us understand why you're experiencing this issue, and from your first message I am assuming you POSTed the insight, could you please confirm that when you perform the POST operation to 'Workspace 2', the request body you are sending is an exact, unmodified copy of the response you receive from the GET call on the insight from 'Workspace 1'? This includes all attributes and properties, ensuring nothing is inadvertently excluded or changed during the transfer. Additionally, we've reviewed our logs and, in the last 3 months, we haven't found any POST call related to the insight ID you provided. We only observed PATCH calls on other workspaces. To ensure we can accurately pinpoint the issue, could you please repeat the process of posting the insight to another workspace and provide us with the following details: • The ID of Workspace 1 (the source workspace from which you are GETting the insight). • The ID of Workspace 2 (the target workspace to which you are POSTing the insight). • The Insight ID you are working with. (Or simply the links) We look forward to your confirmation so we can continue investigating.