# How to get the label of fields from API?

**URL:** <https://discourse.getcockpit.com/t/how-to-get-the-label-of-fields-from-api/1141>\
**Category:** Support\
**Created:** [January 2, 2020, 4:49pm UTC](https://discourse.getcockpit.com/t/how-to-get-the-label-of-fields-from-api/1141 "2020-01-02T16:49:54Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![raffaelj](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.getcockpit.com/raffaelj/32/331_2.png) [@raffaelj](https://discourse.getcockpit.com/u/raffaelj)\
**Post date:** [January 10, 2020, 4:19pm UTC](https://discourse.getcockpit.com/t/how-to-get-the-label-of-fields-from-api/1141/3 "2020-01-10T16:19:45Z")

</div>

Interesting. I never noticed/missed the missing information - and I’m not sure, if it would be a useful default setting. 1. It could bloat the api request and 2. I use the label and the info fields to give clients detailed information about how to fill the content. For the frontend, I’m only interested in the field names…

You could write your own api endpoint:

- Create a file `/path/to/cockpit/config/api/collections/get/collection_name.php`
- copy/paste the content from `modules/Collections/Controller/RestApi.php::get()` with minor modifications
- change the response with your needed field information
- call the api like before `example.com/api/collections/get/collection_name`

---

_[View the full topic](https://discourse.getcockpit.com/t/how-to-get-the-label-of-fields-from-api/1141)._
