Helper/Data.php
public function getApiEndpoint($websiteId, $client)
    {
        //Get from DB
        $apiEndpoint = $this->getApiEndPointFromConfig($websiteId);

        //Nothing from DB then fetch from api
        if (!$apiEndpoint) {
            $apiEndpoint = $this->getApiEndPointFromApi($client);
            //Save it in DB
            if ($apiEndpoint) {
                $this->saveApiEndpoint($apiEndpoint, $websiteId);
            }
        }
        return $apiEndpoint;
    }
public function getApiEndpoint($websiteId, $client)
    {
        //Get from DB
        $apiEndpoint = $this->getApiEndPointFromConfig($websiteId);

        //Nothing from DB then fetch from api
        if (!$apiEndpoint) {
            $apiEndpoint = $this->getApiEndPointFromApi($client);
            //Save it in DB
            if ($apiEndpoint) {
                $this->saveApiEndpoint($apiEndpoint, $websiteId);
            }
        }
        return $apiEndpoint;
    }
public function getApiEndpoint ( $ websiteId , $ client ) { //Get from DB $ apiEndpoint = $ this -> getApiEndPointFromConfig ( $ websiteId ) ; //Nothing from DB then fetch from api if ( ! $ apiEndpoint ) { $ apiEndpoint = $ this -> getApiEndPointFromApi ( $ client ) ; //Save it in DB if ( $ apiEndpoint ) { $ this -> saveApiEndpoint ( $ apiEndpoint , $ websiteId ) ; } } return $ apiEndpoint ; }
Get Api endPoint

@param int $websiteId
@param \Dotdigitalgroup\Email\Model\Apiconnector\Client $client

@return string|
Get Api endPoint