Pour tout problème contactez-nous par mail : support@froggit.fr | La FAQ :grey_question: | Rejoignez-nous sur le Chat :speech_balloon:

Skip to content
Snippets Groups Projects
  • Freezed's avatar
    c8d063a4
    :sparkles: Add activity creation #1 · c8d063a4
    Freezed authored
    Define options
    Options not passed as argument are prompted;
    - if required
    - and default value not set
    
    TODO: Response not correctly formated for status and error
    
            Status:  N/A
            Error:   N/A
    c8d063a4
    History
    :sparkles: Add activity creation #1
    Freezed authored
    Define options
    Options not passed as argument are prompted;
    - if required
    - and default value not set
    
    TODO: Response not correctly formated for status and error
    
            Status:  N/A
            Error:   N/A
api.py 323 B
"""
API utilities
"""

from requests import HTTPError

from strava.api._helpers import client, url, json


def post_activity(xargs):
    """API call to create an activity"""

    response = client.post(url=url("/activities"), data=xargs)
    try:
        return json(response)
    except HTTPError:
        return response