How to get all custom field values for a specific task using the api

eg output of tags:
“data”: [
{
“gid”: “123”,
“name”: "task name ",
“resource_type”: “task”,
“tags”: ,
“resource_subtype”: “default_task”
},

custom_fields output:
“data”: [
{
“gid”: “34256”,
“custom_fields”: [
{
“gid”: “2345”,
“enabled”: true,
“enum_options”: [
{
“gid”: “4357546”,
“color”: “green”,
“enabled”: true,
“name”: “num1”,
“resource_type”: “enum_option”
},
{
“gid”: “25436”,
“color”: “red”,
“enabled”: true,
“name”: “num2”,
“resource_type”: “enum_option”
},
{
“gid”: “25437645”,
“color”: “blue”,
“enabled”: true,
“name”: “num3”,
“resource_type”: “enum_option”
},
{
“gid”: “2435654”,
“color”: “hot-pink”,
“enabled”: true,
“name”: “num4”,
“resource_type”: “enum_option”
},

so it doesnt group the num4,num1 belongs to task x