src/Client.php
public function setWebhook($url, $eventTypes = null)
    {
        if (null === $eventTypes) {
            $eventTypes = [Type::SUBSCRIBED, Type::CONVERSATION, Type::MESSAGE];
        }
        if (empty($url) || !preg_match('|^https://.*|s', $url)) {
            throw new ApiException('Invalid webhook url: ' . $url);
        }

        return $this->call('set_webhook', [
            'url' => $url,
            'event_types' => $eventTypes,
        ]);
    }
public function setWebhook($url, $eventTypes = null)
    {
        if (null === $eventTypes) {
            $eventTypes = [Type::SUBSCRIBED, Type::CONVERSATION, Type::MESSAGE];
        }
        if (empty($url) || !preg_match('|^https://.*|s', $url)) {
            throw new ApiException('Invalid webhook url: ' . $url);
        }

        return $this->call('set_webhook', [
            'url' => $url,
            'event_types' => $eventTypes,
        ]);
    }
public function setWebhook ( $ url , $ eventTypes = null ) { if ( null === $ eventTypes ) { $ eventTypes = [ Type :: SUBSCRIBED , Type :: CONVERSATION , Type :: MESSAGE ] ; } if ( empty ( $ url ) || ! preg_match ( '|^https://.*|s' , $ url ) ) { throw new ApiException ( 'Invalid webhook url: ' . $ url ) ; } return $ this -> call ( 'set_webhook' , [ 'url' => $ url , 'event_types' => $ eventTypes , ] ) ; }
Set webhook url.

For security reasons only URLs with valid and * official SSL certificate
from a trusted CA will be allowed.

@see \Viber\Api\Event\Type
@throws \Viber\Api\Exception\ApiException
@param string $url webhook url
@param array|null $eventTypes subscribe to certain events
@return \Viber\Api\Response
Set webhook url .