<?php

use Magento\Framework\App\Bootstrap;
use Magento\Framework\App\ObjectManager;
use Magento\Framework\App\State;
use FiloBlu\ActiveCampaign\Model\Connector\Rest;

require __DIR__ . '/../../../../../bootstrap.php';
$params = $_SERVER;
$bootstrap = Bootstrap::create(BP, $params);
$obj = $bootstrap->getObjectManager();
$state = $obj->get(State::class);
$state->setAreaCode('adminhtml');
$objectManager = ObjectManager::getInstance();


/** @var Rest $restConnector */
$restConnector = $objectManager->get(Rest::class);
$restConnector->connect();
$response = $restConnector->doRequest('users');
$status = $response->getStatusCode(); // 200 status code
$responseBody = $response->getBody();
$responseContent = $responseBody->getContents();

echo 'Status Code: '.$status."\n--------------------------\n";
echo 'Response: '.$responseContent."\n--------------------------\n";
echo "Done\n";



