def DownloadActivity(self, serviceRecord, activity):

        workoutId = activity.ServiceData["workoutId"]
        logger.debug("Download PWX export with ID: " + str(workoutId))
        params = self._add_auth_params({}, record=serviceRecord)
        res = requests.get(self._urlRoot + "/export/activity/pwx/{}".format(workoutId), params=params)

        if res.status_code != 200:
          if res.status_code == 403:
            raise APIException("No authorization to download activity with workout ID: {}".format(workoutId), block=True, user_exception=UserException(UserExceptionType.Authorization, intervention_required=True))
          raise APIException("Unable to download activity with workout ID: {}".format(workoutId))

        activity = PWXIO.Parse(res.content, activity)

        return activity
GET Activity as a PWX File
dataset/ETHPy150Open cpfair/tapiriik/tapiriik/services/VeloHero/velohero.py/VeloHeroService.DownloadActivity