I’m not clear on what the question is. If you’re saying you’re currently getting the custom fields, then what are you needing that you’re not currently getting?
The specifics of how to do it will depend on the language and/or library you’re using.
In general: you’ll get a task object in whatever way you do and it will contain an array of custom field values for that task, as described here in the docs. Each of those values will include the id of the custom field. Take that id and call the /custom_fields/custom_field-id endpoint (where you put that id as custom-field-id in that call) as described here in the docs to get the metadata for that custom field (its name, type, and possible values for an enum type).