Execute the service.

        For interactive (notebook) service execution, set interactive to True, defaults to False.

        .. versionadded:: 1.13

        :param interactive: (optional) True if the notebook service should execute in interactive mode.
        :type interactive: bool or None
        :return: ServiceExecution when successful.
        :raises APIError: when unable to execute

def execute(self, interactive=False):
        """
        Execute the service.

        For interactive (notebook) service execution, set interactive to True, defaults to False.

        .. versionadded:: 1.13

        :param interactive: (optional) True if the notebook service should execute in interactive mode.
        :type interactive: bool or None
        :return: ServiceExecution when successful.
        :raises APIError: when unable to execute
        """
        url = self._client._build_url('service_execute', service_id=self.id)
        response = self._client._request('GET', url, params=dict(interactive=interactive, format='json'))

        if response.status_code != requests.codes.accepted:  # pragma: no cover
            raise APIError("Could not execute service '{}': {}".format(self, (response.status_code, response.json())))

        data = response.json()
        return ServiceExecution(json=data.get('results')[0], client=self._client)