null]); exit; } $glpi = new GlpiApi(GLPI_API_URL, GLPI_APP_TOKEN, GLPI_USERNAME, GLPI_PASSWORD); $computer = $glpi->getItem('Computer', $computerId); if ($computer && isset($computer['locations_id'])) { echo json_encode(['location_id' => $computer['locations_id']]); } else { echo json_encode(['location_id' => null]); }