def DownloadActivity(self, serviceRecord, activity):
        """
        GET Activity as a PWX File

        URL: https://app.velohero.com/export/activity/pwx/<WORKOUT-ID>
        Parameters:
        user = username
        pass = password

        PWX export with laps.
        """

        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),
                           headers=self._obligatory_headers,
                           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

        URL: https://app.velohero.com/export/activity/pwx/<WORKOUT-ID>
        Parameters:
        user = username
        pass = password

        PWX export with laps.
        
tapiriik/services/VeloHero/velohero.py