Hello. I have two values at the beginning: one custom field and the other item id (obtained via: return_item_ids = 1).
I need to get the owner’s name. please, give me an advice.
This application is supposed to find the owner by customfield.
$ico = new Ico();
$form = $this->createForm(IcoFormType::class, $ico);
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
$ico = $form->getData();
$response = $client->request('GET', 'searchResults/field?term=' . $ico .
'&field_type=organizationField&field_key=' . $icoField . '&return_item_ids=1&api_token=' .
$apiToken);
$data = json_decode($response->getBody()->getContents());
foreach($data->data as $dete);
$id = ($dete->id);
dump($data);
/* $response = $client->request('GET', 'organizationFields/' . $id . '?api_token=' . $apiToken);
dump(json_decode($response->getBody()->getContents()));
die();*/
}
the result is:
{#1035 ▼
+“success”: true
+“data”: array:1 [▼
0 => {#1021 ▼
+“id”: 9
+“0bfb0bde92a54702282a67a7a5759902f505ad64”: “45148066”
}
]
+“additional_data”: {#821 ▼
+“pagination”: {#1031 ▼
+“start”: 0
+“limit”: 100
+“more_items_in_collection”: false
}
}
}