Get field-name from the API api/card

Hi,

I am trying to use the API api/card.

The “dataset_query” section contains this:

[quote=“Romain1, post:1, topic:3218, full:true”]
Hi,

I am trying to use the API api/card.

The “dataset_query” section contains this:
“filter”: [
“AND”,
[
“CONTAINS”,
[
“field-id”,
3752
],
“.org”
]

This filter refers to a field-id 3752. How can I get the field name from this?

Below is a full response example:
{
“description”: null,
“archived”: false,
“labels”: [],
“table_id”: 210,
“result_metadata”: [
{
“base_type”: “type/DateTime”,
“display_name”: “Action Date”,
“name”: “action_date”,
“unit”: “default”
},
{
“base_type”: “type/Text”,
“display_name”: “Action Description”,
“name”: “action_description”
},
{
“base_type”: “type/Integer”,
“display_name”: “Action External ID”,
“name”: “action_external_id”
}
],
“creator”: {
“email”: "rl@link2b.fr",
“first_name”: “nte”,
“last_login”: “2018-03-16T12:21:00.432Z”,
“is_qbnewb”: false,
“is_superuser”: true,
“id”: 1,
“last_name”: “nte”,
“date_joined”: “2018-03-05T19:34:37.713Z”,
“common_name”: “nte nte”
},
“database_id”: 4,
“enable_embedding”: false,
“collection_id”: null,
“query_type”: “query”,
“name”: “Contacts .org”,
“in_public_dashboard”: false,
“creator_id”: 1,
“updated_at”: “2018-03-28T11:56:00.108Z”,
“made_public_by_id”: null,
“embedding_params”: null,
“cache_ttl”: null,
“dataset_query”: {
“database”: 4,
“type”: “query”,
“query”: {
“source_table”: 210,
“filter”: [
“AND”,
[
“CONTAINS”,
[
“field-id”,
3752
],
“.org”
]
]
}
},
“id”: 101,
“display”: “table”,
“visualization_settings”: {
“table.columns”: [
{
“name”: “action_date”,
“enabled”: false
},
{
“name”: “action_description”,
“enabled”: false
},
{
“name”: “action_external_id”,
“enabled”: false
},
{
“name”: “action_id”,
“enabled”: false
}
]
},
“collection”: null,
“favorite”: false,
“created_at”: “2018-03-28T11:50:10.244Z”,
“public_uuid”: null
}

I would guess a call to GET /api/field/:id would return it?

I haven’t tested this out though - please share how it goes :slight_smile:

Hi Jornh,

Perfect. You make my day. It works.

Funny enough, I couldn’t find the information by myself in the documentation…
in fact, the documentation is there but from the description “Get Field with ID” I could not see that was what I needed. Perhaps a little text update in the doc to make that more understandable?

thanks for your help.

Extract of the doc:

GET /api/field/:id
Get Field with ID.

PARAMS:
id
1 Like