Hey all, I'm looking at the data catalog in goodd...
# gooddata-cloud
s
Hey all, I'm looking at the data catalog in gooddata and wondering if there is any capacity to things out of gooddata using metrics or insights from the definitions there • like from an API • Example use case ◦ I have metric in gooddata defined as x ◦ Using a users api token -> use the api to get the outputs of that metric through gooddata? ▪︎ Reason I'm curious is we have tenancy, userpermissions, groups, etc. + api tokens in our system already
k
⚠️ We apologize, but for some unknown reason, your installation with this app is no longer available. Please reinstall this app into your workspace 🙇
s
@kapa.ai Does that work for insights too?
k
New message text here
m
Hi Steve, The response of our AI Assistant is correct. Please give it a try and let us know, we will be happy to help further.
s
@Jonathan Silver fyi
👀 1
@kapa.ai can you recover the api call to get a metric definition?
k
Sure! To retrieve a specific metric definition from GoodData, you make a GET request to:
Copy code
GET /api/v1/entities/workspaces/{workspaceId}/metrics/{objectId}
[Get a Metric] Example using
curl
Copy code
curl $HOST_URL/api/v1/entities/workspaces/<workspace_id>/metrics/<metric_id> \
  -H 'Authorization: Bearer $API_TOKEN'
Example using the Python SDK (
gooddata_api_client
)
Copy code
import gooddata_api_client
from gooddata_api_client.api import metrics_api
from pprint import pprint

configuration = gooddata_api_client.Configuration(
    host="http://localhost"
)

with gooddata_api_client.ApiClient() as api_client:
    api_instance = metrics_api.MetricsApi(api_client)
    workspace_id = "workspaceId_example"
    object_id = "objectId_example"

    try:
        api_response = api_instance.get_entity_metrics(workspace_id, object_id)
        pprint(api_response)
    except gooddata_api_client.ApiException as e:
        print("Exception: %s\n" % e)
[MetricsApi docs] What the response includes The returned metric entity contains: •
id
– the metric's unique identifier •
attributes.title
– human-readable name •
attributes.content.maql
– the MAQL expression defining the metric •
attributes.content.format
– the display format (e.g.
$#,##0
) •
attributes.description
,
tags
,
createdAt
,
modifiedAt
, etc. [OpenAPI schema] You can also use optional query parameters like
include
(to pull in related facts, attributes, datasets, etc.) and
filter
(RSQL-based filtering). 👍 0 button 👎 0 button ℹ️ Tip: Mention @kapa.ai in the thread for follow-ups. 👀 Our Support team monitors all messages and will jump in if needed.
s
@kapa.ai can you show me how to use the metric id to pull actual data
k
New message text here
s
@kapa.ai what API call do I make to retrieve or update a user's permission. I'm not able to find it in the Gooddata UI.
k
New message text here
s
@kapa.ai I'm back on the example AFM, how do I get the localidentifier for the objects. I have a metric with a defined id such as: act_vs_est_hours, can I use that?
k
New message text here
s
@kapa.ai ah ok, so its my identifier that I use for tracing/tracking.
k
New message text here