def token(self, value):
        """
        Set the Token of the message.

        :type value: String
        :param value: the Token
        :raise AttributeError: if value is longer than 256
        """
        if value is None:
            self._token = value
            return
        if not isinstance(value, str):
            value = str(value)
        if len(value) > 256:
            raise AttributeError
        self._token = value