run(APP::EXEC_MODE_API); API::setWrapper(); $client = new ScimApiClient(); $client->setServiceFactory(new CRegistryFactory([ 'users' => User::class, 'groups' => Group::class, 'serviceproviderconfig' => ServiceProviderConfig::class ])); $scim = new SCIM(); $response = $scim->execute($client, $request); } catch (Throwable $e) { $response = new HttpResponse(); $exception = $e instanceof APIException ? $e : new APIException(ZBX_API_ERROR_INTERNAL, $e->getMessage()); $response->setException($exception); } $response->send();