Show examples in:
Javascript HTTP
Endpoint info
Available examples

Content Management API > Field

Retrieve a field

Returns

Returns a resource object of type field.

Examples

1
GET https://site-api.datocms.com/fields/:field_id_or_api_key HTTP/1.1
2
Authorization: Bearer YOUR-API-TOKEN
3
Accept: application/json
4
X-Api-Version: 3
Terminal window
1
curl -g 'https://site-api.datocms.com/fields/:field_id_or_api_key' \
2
\
3
-H "Authorization: Bearer YOUR-API-TOKEN" \
4
-H "Accept: application/json" \
5
-H "X-Api-Version: 3"
1
await fetch("https://site-api.datocms.com/fields/:field_id_or_api_key", {
2
headers: {
3
Authorization: "Bearer YOUR-API-TOKEN",
4
Accept: "application/json",
5
"X-Api-Version": "3",
6
},
7
});
1
HTTP/1.1 200 OK
2
Content-Type: application/json
3
Cache-Control: cache-control: max-age=0, private, must-revalidate
4
X-RateLimit-Limit: 30
5
X-RateLimit-Remaining: 28
6
7
{
8
"data": {
9
"type": "field",
10
"id": "Pkg-oztERp6o-Rj76nYKJg",
11
"attributes": {
12
"label": "Title",
13
"field_type": "string",
14
"api_key": "title",
15
"localized": true,
16
"validators": {
17
"required": {}
18
},
19
"position": 1,
20
"hint": "This field will be used as post title",
21
"default_value": {
22
"en": "A default value",
23
"it": "Un valore di default"
24
},
25
"appearance": {
26
"editor": "single_line",
27
"parameters": {
28
"heading": false
29
},
30
"addons": [
31
{
32
"id": "1234",
33
"field_extension": "lorem_ipsum",
34
"parameters": {}
35
}
36
]
37
},
38
"deep_filtering_enabled": true
39
},
40
"relationships": {
41
"item_type": {
42
"data": {
43
"type": "item_type",
44
"id": "DxMaW10UQiCmZcuuA-IkkA"
45
}
46
},
47
"fieldset": {
48
"data": null
49
}
50
}
51
}
52
}