public function addTag($id, $tag, $fromAdminId = null, $botName = 'Bot', $randomId = 0)
    {
        if ($this->isEmptyId($id)) {
            throw new InvalidArgumentException;
        }

        if (!$tag) {
            throw new InvalidArgumentException;
        }

        $tag = str_replace(',', '', $tag);

        $params = [
            'action' => 'add',
            'tag' => $tag
        ];

        $fromAdminId = (int)$fromAdminId;
        if ($fromAdminId) {
            $params['from_admin'] = $fromAdminId;
        } else {
            $params['bot_name'] = $botName;
        }

        $randomId = (int)$randomId;
        if ($randomId) {
            $params['random_id'] = $randomId;
        }

        $res = $this->call('conversations/' . $id . '/tag', $params, 'post');

        if ($res) {
            return true;
        }

        return false;
    }
public function addTag($id, $tag, $fromAdminId = null, $botName = 'Bot', $randomId = 0)
    {
        if ($this->isEmptyId($id)) {
            throw new InvalidArgumentException;
        }

        if (!$tag) {
            throw new InvalidArgumentException;
        }

        $tag = str_replace(',', '', $tag);

        $params = [
            'action' => 'add',
            'tag' => $tag
        ];

        $fromAdminId = (int)$fromAdminId;
        if ($fromAdminId) {
            $params['from_admin'] = $fromAdminId;
        } else {
            $params['bot_name'] = $botName;
        }

        $randomId = (int)$randomId;
        if ($randomId) {
            $params['random_id'] = $randomId;
        }

        $res = $this->call('conversations/' . $id . '/tag', $params, 'post');

        if ($res) {
            return true;
        }

        return false;
    }
public function addTag ( $ id , $ tag , $ fromAdminId = null , $ botName = 'Bot' , $ randomId = 0 ) { if ( $ this -> isEmptyId ( $ id ) ) { throw new InvalidArgumentException ; } if ( ! $ tag ) { throw new InvalidArgumentException ; } $ tag = str_replace ( ',' , '' , $ tag ) ; $ params = [ 'action' => 'add' , 'tag' => $ tag ] ; $ fromAdminId = ( int ) $ fromAdminId ; if ( $ fromAdminId ) { $ params [ 'from_admin' ] = $ fromAdminId ; } else { $ params [ 'bot_name' ] = $ botName ; } $ randomId = ( int ) $ randomId ; if ( $ randomId ) { $ params [ 'random_id' ] = $ randomId ; } $ res = $ this -> call ( 'conversations/' . $ id . '/tag' , $ params , 'post' ) ; if ( $ res ) { return true ; } return false ; }
Add tag to dialogue.

@param int $id - conversation ID
@param string $tag
@param int|null - admin from assignment
@param string $botName
@param int $randomId - number for control delivery

@return bool

@throws InvalidArgumentException
@throws Exception
Add tag to dialogue .