API Keys - the keys other systems use the API with. Each acts as * an agent, so each shows who, what their role opens and which clients * they see, whether the key works (it expires, and an agent who is * disabled, archived or has no role turns every call away) and when it was * last used. The work is in functions/api_keys.php; the handlers are * admin/post/api_keys.php. */ require_once "includes/inc_all_admin.php"; $search = trim((string) ($_GET['q'] ?? '')); $keys = apiKeyRows($search); $roles = roleRows(); $access = userClientAccess(array_filter(array_map('intval', array_column($keys, 'api_key_user_id')))); $csrf = $_SESSION['csrf_token']; ?>

API Keys

A key lets another system use ITFlow's API as one of your agents - it can do what their role allows, for the clients they see, until it expires.

$row) { $name = escapeHtml($row['api_key_name']); $role = $roles[intval($row['user_role_id'])] ?? null; $expired = apiKeyExpired($row); $agent_name = trim(str_replace(' (archived)', '', (string) $row['user_name'])); $last_used = $row['api_key_last_used_at'] ? '' . escapeHtml(timeAgo($row['api_key_last_used_at'])) . '' : 'Never'; ob_start(); ?>
Nobody' . escapeHtml(userClientAccessText($access[intval($row['api_key_user_id'])] ?? ['allow' => [], 'deny' => []], intval($role['role_is_admin']))) . '' : 'Nothing'; ?>
Key Acts as Can open Last used Action
•••• · made
Last used
'API keys', 'icon' => 'fa-key', 'text' => 'A key lets another system read and write ITFlow through its API, as one of your agents.', 'filtered' => $search !== '', 'clear_url' => 'api_keys.php', 'actions' => [['label' => 'New API Key', 'modal' => 'modals/api/api_key_add.php']], ]) ?>