Menu
shell
  • Swagger
  • Authentication
  • Errors
  • Events
  • Subscribers
  • Users
  • Auth
  • Contributing
  • Roadmap
  • Introduction

    The Sport Activities API allows creation and organisation of events (conjunction of a place, a date, and people). It's internationally available.

    In France, a frontend is bound to this API on : https://activites.decathlon.fr

    At the moment, this application is for INTERNAL USE only. But our goal is to make it usable by partners.


    Swagger

    You can find a Swagger UI of our API on the endpoint below, where you can see and try all the endpoints.

    https://api-eu.decathlon.net/activities/api/swagger


    Authentication

    An Api Key is required for all api calls. Currently, to obtain an api key, you must contact us. Only GET /v1/events is available without JWT token.

    Everything else is accessible either with FED token or decathlon connect token.

    To access a secured resource, you must respect this header E.g.: Authorization: Bearer XXXXXXXXX


    Errors

    The Sport Places API uses the following error codes:

    Error Code Meaning
    400 Bad Request -- Your request is invalid - check the JSON format of your request.
    401 Unauthorized -- Your token is invalid or expired.
    403 Forbidden -- You are not allowed.
    404 Not Found -- The specified place or activity wasn't found.
    422 Unprocessable Entity -- There was a validation error with your request.
    498 Token Expired -- temporay, will be removed when refresh token implemented
    500 Internal Server Error -- We had a problem with our server. Try again later.


    Events

    In this section, you will find uses of the events endpoints.

    The Extra_location is a json object storing what you need to display your event location. In our case, it's Google Maps, but it could be anything else.

    The sport_id is linked to your sports referential system. It could be any id you want.

    Levels referential:

    Value Reference
    5 BEGINNER
    10 GOOD
    20 EXPERT

    On every paginated endpoint you can pass a header to specify which limit you'd like:

    Parameter Example Format
    X-Desired-Limit 25 int (default: 25)

    List of sport activities

    HTTP Request

    curl -X GET \
      "https://api-eu.decathlon.net/activities/v1/events?latitude=50.617922&longitude=3.081998&level[]=5&level[]=10"
      -H 'X-Api-Key: aaa-bbb-ccc'
    

    JSON response:

    {
      "data": [
        {
          "id": 1,
          "title": "Running meeting",
          "status": "PUBLISHED",
          "description": "My little description",
          "start_date": "2018-06-27T17:00:48Z",
          "end_date": "2018-06-29T19:00:48Z",
          "publish_date": null,
          "picture": null,
          "sport_id": 294,
          "latitude": 50.62925,
          "longitude": 3.057256,
          "level": [
            5,
            10
          ],
          "extra_location": {
            "place_id": "ChIJYR2_AuYpw0cRcLCWaO3QHKE",
            "autocomplete_name":"Decathlon Croix, Rue de la Centenaire, Croix, France",
            "custom_adress": {
              "name": "Decathlon Croix",
              "adress": "12 Rue de la Centenaire",
              "address_zip": "59170 Croix, France",
            },
            "formatted_address": "12 Rue de la Centenaire, 59170 Croix, France",
          },
          "age_min": 1,
          "age_max": 100,
          "slots_limit": 7,
          "slots": 7,
          "owner": {
            "id": "28cce8e0-2d57-4e54-8888-2fc69690aeeb",
            "type": "FED",
            "name": "Guillaume W",
            "photo": "//iam.subsidia.org/photos/users/CCATCH08.jpg",
            "title": "INGENIEUR SI",
            "site_id": "0070064800648",
            "mail": "cyrille.catcha@decathlon.com",
            "site": {
              "id": 648,
              "name": "Magasin b'Twin village",
            }
          },
          "owner_message": null,
          "equipment_provided": null,
          "equipment_required": null,
          "equipment_linked": [],
          "subscription_disabled": false
        }
      ],
      "links": {
        "first": "/v1/events?latitude=50.617922&longitude=3.081998&level[]=5&level[]=10&page=1",
        "last": "/v1/events?latitude=50.617922&longitude=3.081998&level[]=5&level[]=10&page=1",
        "prev": null,
        "next": null
      },
      "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "path": "/v1/events",
        "per_page": 25,
        "to": 1,
        "total": 1
      }
    }
    

    This endpoint retrieves all events meeting specific criteria.

    Query Parameters

    Parameter Example Format
    latitude 50.62925 number required
    longitude 3.057256 number required
    sport 182 int
    start_date 2018-07-21T17:32:28Z iso UTC datetime (no millis)
    end_date 2018-07-21T17:32:28Z iso UTC datetime (no millis)
    distance 100 int (default: 100)
    age_min 1 int
    age_max 100 int
    level[] 5 array(int)

    Add a new sport activity

    curl -X POST \
      https://api-eu.decathlon.net/activities/v1/events \
      -H 'Accept: application/json' \
      -H 'X-Api-Key: aaa-bbb-ccc' \
      -H 'Authorization: Bearer XXXXXXX' \
      -d '{
      "title": "Test title",
      "description": "Test description",
      "start_date": "2018-07-21T17:32:28Z",
      "end_date": "2018-07-25T17:32:28Z",
      "publish_date": null,
      "picture": "http://foo.bar/jdoe.jpg",
      "sport_id": 186,
      "latitude": 50.6456406,
      "longitude": 3.1400856,
      "level": [5],
      "age_min": 5,
      "age_max": 19,
      "slots": 60,
      "owner_message": "Test organizer message",
      "equipment_provided": "Test provided equipment",
      "equipment_required": "Test required equipment",
      "equipment_linked": [],
      "subscription_disabled": false
    }'
    

    JSON response:

    {
      "data": {
        "id": 1,
        "title": "Test title",
        "description": "Test description",
        "start_date": "2018-07-21T17:32:28Z",
        "end_date": "2018-07-25T17:32:28Z",
        "publish_date": null,
        "picture": "http://foo.bar/jdoe.jpg",
        "sport_id": 186,
        "latitude": 50.6456406,
        "longitude": 3.1400856,
        "extra_location": null,
        "level": [5],
        "age_min": 5,
        "age_max": 49,
        "slots": 60,
        "owner_message": "Test organizer message",
        "equipment_provided": "Test provided equipment",
        "equipment_required": "Test required equipment",
        "equipment_linked": [],
        "subscription_disabled": false,
        "owner": {
          "id": "28cce8e0-2d57-4e54-8888-2fc69690aeeb",
          "type": "FED",
          "name": "John D",
          "photo": "//iam.subsidia.org/photos/users/JOHND02.jpg",
          "title": "Leader magasin",
          "site_id": "0070064800648",
          "mail": "hello@world.com",
          "site": {
            "id": 648,
            "name": "Magasin b'Twin village",
          }
        }
      }
    }
    

    Query body

    Parameter Example Format
    title Test string required
    description Test text required
    picture http://link string
    sport_id 182 int required
    start_date 2018-07-08T17:32:28Z date (utc) required
    end_date 2018-07-08T19:32:28Z date (utc) required
    latitude 50.6456406 number required
    longitude 3.1400856 number required
    level [5] array of int [5,10,20] required
    age_min 1 int required
    age_max 100 int required
    slots 100 int required
    owner_message Hello world text
    equipment_provided Test text
    equipment_required Test text

    This endpoint create a new sport activity.

    Modify a sport activity

    curl -X PATCH \
      https://api-eu.decathlon.net/activities/v1/events/1 \
      -H 'Accept: application/json' \
      -H 'X-Api-Key: aaa-bbb-ccc' \
      -H 'Authorization: Bearer XXXXXXX' \
      -d '{
      "title": "Test title 2"
    }'
    

    JSON response:

    {
      "data": {
        "id": 1,
        "title": "Test title 2",
        "status": "PUBLISHED",
        "description": "Test description",
        "start_date": "2018-07-21T17:32:28Z",
        "end_date": "2018-07-25T17:32:28Z",
        "publish_date": null,
        "picture": "http://foo.bar/jdoe.jpg",
        "sport_id": 186,
        "latitude": 50.6456406,
        "longitude": 3.1400856,
        "extra_location": null,
        "level": [5],
        "age_min": 5,
        "age_max": 49,
        "slots": 60,
        "owner_message": "Test organizer message",
        "equipment_provided": "Test provided equipment",
        "equipment_required": "Test required equipment",
        "equipment_linked": [],
        "subscription_disabled": false,
        "owner": {
          "id": "28cce8e0-2d57-4e54-8888-2fc69690aeeb",
          "type": "FED",
          "name": "John D",
          "photo": "//iam.subsidia.org/photos/users/JOHND02.jpg",
          "title": "Leader magasin",
          "site_id": "0070064800648",
          "mail": "hello@world.com",
          "site": {
            "id": 648,
            "name": "Magasin b'Twin village",
          }
        }
      }
    }
    

    Query body

    Same body as the previous endpoint, but you can just pass the fields you want to modify

    Get a sport activity

    curl -X GET \
      https://api-eu.decathlon.net/activities/v1/events/1 \
      -H 'Accept: application/json' \
      -H 'X-Api-Key: aaa-bbb-ccc' \
      -H 'Authorization: Bearer XXXXXXX'
    

    JSON response:

    {
      "data": {
        "id": 1,
        "title": "Test title 2",
        "status": "PUBLISHED",
        "description": "Test description",
        "start_date": "2018-07-21T17:32:28Z",
        "end_date": "2018-07-25T17:32:28Z",
        "picture": "http://foo.bar/jdoe.jpg",
        "sport_id": 186,
        "latitude": 50.6456406,
        "longitude": 3.1400856,
        "extra_location": null,
        "level": [5],
        "age_min": 5,
        "age_max": 49,
        "slots": 60,
        "owner_message": "Test organizer message",
        "equipment_provided": "Test provided equipment",
        "equipment_required": "Test required equipment",
        "equipment_linked": [],
        "subscription_disabled": false,
        "owner": {
          "id": "28cce8e0-2d57-4e54-8888-2fc69690aeeb",
          "type": "FED",
          "name": "John D",
          "photo": "//iam.subsidia.org/photos/users/JOHND02.jpg",
          "title": "Leader magasin",
          "site_id": "0070064800648",
          "mail": "hello@world.com",
          "site": {
            "id": 648,
            "name": "Magasin b'Twin village",
          }
        },
      }
    }
    

    Show a sport activity resource. If you try to access a pending event that belongs to you, you will need to pass the JWT token, just to make sure that you can access the data.

    Cancel a sport activity

    HTTP Request

    curl -X POST \
      https://api-eu.decathlon.net/activities/v1/events/1/cancel \
      -H 'Authorization: Bearer XXXXXX' \
      -H 'X-Api-Key: aaa-bbb-ccc'
    

    JSON response:

    {
      "data": {
        "id": 1,
        "status": "CANCELED",
        ...
      }
    }
    

    Cancel a sport activity if you are allowed to.

    Duplicate a sport activity

    HTTP Request

    curl -X POST \
      https://api-eu.decathlon.net/activities/v1/events/1/duplicate \
      -H 'Authorization: Bearer XXXXXX' \
      -H 'X-Api-Key: aaa-bbb-ccc'
    

    JSON response:

    {
      "data": {
        "id": 3,
        "status": "PENDING",
        ...
      }
    }
    

    Duplicate a sport activity in pending status. To publish the event, you will have to do a PATCH on the status field

    Get list of created or subscribed sport activities

    HTTP Request

    curl -X GET \
      "https://api-eu.decathlon.net/activities/v1/events/mine?type=created"
      -H 'X-Api-Key: aaa-bbb-ccc'
    

    JSON response:

    {
      "data": [
        {
          "id": 1,
          "title": "Running meeting",
          "status": "PUBLISHED",
          "description": "My little description",
          "start_date": "2018-06-27T17:00:48Z",
          "end_date": "2018-06-29T19:00:48Z",
          "sport_id": 294,
          "latitude": 50.62925,
          "longitude": 3.057256,
          "level": [
            5,
            10
          ],
          "extra_location": null,
          "age_min": 1,
          "age_max": 100,
          "slots_limit": 7,
          "slots": 7,
          "owner": {
            "id": "28cce8e0-2d57-4e54-8888-2fc69690aeeb",
            "type": "FED",
            "name": "Guillaume W",
            "photo": "//iam.subsidia.org/photos/users/CCATCH08.jpg",
            "title": "INGENIEUR SI",
            "site_id": "0070064800648",
            "mail": "cyrille.catcha@decathlon.com",
            "site": {
              "id": 648,
              "name": "Magasin b'Twin village",
            }
          },
          "owner_message": null,
          "equipment_provided": null,
          "equipment_required": "Test required equipment",
          "equipment_linked": [],
          "subscription_disabled": false,
        }
      ],
      "links": {
        "first": "/v1/events/mine?type=created&page=1",
        "last": "/v1/events/mine?type=created&page=1",
        "prev": null,
        "next": null
      },
      "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "path": "/v1/events/mine",
        "per_page": 25,
        "to": 1,
        "total": 1
      }
    }
    

    This endpoint retrieves events according to the type parameter. In case of subscribed type, you can pass an event parameter that will allow you to know if the authenticated user has subscribed to this sport actity.

    Query Parameters

    Parameter Example Format
    type created string required
    event 1 integer


    Subscribers

    In this section, you will find uses of the events subscribers endpoints.

    On every paginated endpoint you can pass a header to specify which limit you'd like:

    Parameter Example Format
    X-Desired-Limit 25 int (default: 25)

    List subscribers of a sport activity

    HTTP Request

    curl -X GET \
      "https://api-eu.decathlon.net/activities/v1/events/1/subscribers"
      -H 'Authorization: Bearer XXXXXXX' \
      -H 'X-Api-Key: aaa-bbb-ccc'
    

    JSON response:

    {
      "data": [
        {
          "id": "28cce8e0-2d57-4e54-8888-2fc69690aeeb",
          "type": "FED",
          "name": "John D",
          "photo": "//iam.subsidia.org/photos/users/JOHND01.jpg",
          "title": "Leader magasin",
          "site_id": "0070064800648",
          "mail": "hello@world.com",
          "site": {
            "id": 648,
            "name": "Magasin b'Twin village",
          },
          "additional_subscribers":0,
          "has_attended": false,
          "children": []
        },
        {
          "id": "3d416216-7a1d-11e8-adc0-fa7ae01bbebc",
          "type": "DKTCONNECT",
          "name": "John2 D",
          "additional_subscribers":0,
          "has_attended": false,
          "children": []
        },
      ],
      "links": {
        "first": "/v1/events/1/subscribers?page=1",
        "last": "/v1/events/1/subscribers?page=1",
        "prev": null,
        "next": null
      },
      "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "path": "/v1/events/1/subscribers",
        "per_page": 25,
        "to": 1,
        "total": 1
      }
    }
    

    This endpoint retrieves all subscribers of an event.

    Add a new subscriber to an event

    curl -X POST \
      https://api-eu.decathlon.net/activities/v1/events/1/subscribers \
      -H 'Accept: application/json' \
      -H 'X-Api-Key: aaa-bbb-ccc' \
      -H 'Authorization: Bearer XXXXXXX' \
      -d '{
      "user": "4c68165b-3869-4c22-8098-a4a429c97509"
    }'
    

    JSON response:

    {
      "data": true
    }
    

    Query body

    Parameter Example Format
    user 4c68165b-3869-4c22-8098-a4a429c97509 string required (uuid)
    children [{"name":"Suzie"}] array

    Update a subscriber

    curl -X PATCH \
      https://api-eu.decathlon.net/activities/v1/events/1/subscribers/4c68165b-3869-4c22-8098-a4a429c97509 \
      -H 'Accept: application/json' \
      -H 'X-Api-Key: aaa-bbb-ccc' \
      -H 'Authorization: Bearer XXXXXXX' \
      -d '{
      "has_attended": true,
      "children": [
        {
          "name": "Suzie"
        },
        {
          "name": "Michael"
        }
      ]
    }'
    

    JSON response:

    {
      "data": true
    }
    

    Query body

    Parameter Example Format
    has_attended true boolean
    children [{"name":"Suzie"}] array

    Remove a subscriber from an event

    HTTP Request

    curl -X DELETE \
      https://api-eu.decathlon.net/activities/v1/events/1/subscribers/4c68165b-3869-4c22-8098-a4a429c97509 \
      -H 'Authorization: Bearer XXXXXX' \
      -H 'X-Api-Key: aaa-bbb-ccc'
    

    JSON response:

    {
      "data": true
    }
    

    This request unsubscribe a user.

    Get my subscription info

    curl -X GET \
      https://api-eu.decathlon.net/activities/v1/events/1/subscribers/me \
      -H 'Accept: application/json' \
      -H 'X-Api-Key: aaa-bbb-ccc' \
      -H 'Authorization: Bearer XXXXXXX'
    

    JSON response:

    {
      "id": "28cce8e0-2d57-4e54-8888-2fc69690aeeb",
      "type": "FED",
      "name": "John D",
      "photo": "//iam.subsidia.org/photos/users/JOHND01.jpg",
      "title": "Leader magasin",
      "site_id": "0070064800648",
      "mail": "hello@world.com",
      "site": {
        "id": 648,
        "name": "Magasin b'Twin village",
      },
      "additional_subscribers":0,
      "has_attended": false,
      "children": []
    }
    

    Query body

    Parameter Example Format
    has_attended true boolean
    children [{"name":"Suzie"}] array


    Users

    In this section, you will find uses of the users endpoints.

    User's type referential:

    Value Reference
    FED FED users
    DKTCONNECT DKTCONNECT users

    Search a user by external_id

    HTTP Request

    curl -X GET \
      "https://api-eu.decathlon.net/activities/v1/users/search_user_by_external_id?external_id=ZXXDOEJ&type=FED"
      -H 'Authorization: Bearer XXXXXXX' \
      -H 'X-Api-Key: aaa-bbb-ccc'
    

    JSON response:

    {
        "data": [
            {
                "id": "1c4884b6-c92b-4b0a-9808-373049fe6c25",
                "type": "FED",
                "name": "John D",
                "photo": "//iam.subsidia.org/photos/users/JOHND01.jpg",
                "title": "Leader magasin",
                "site_id": "0070064800648",
                "mail": "hello@world.com",
                "site": {
                    "id": 648,
                    "name": "Magasin b'Twin village"
                }
            }
        ]
    }
    

    This endpoint allows you to find a user by type and external id. Useful if you want to know the newly registered user's uuid


    Auth

    In this section, you will find uses of the auth endpoints.

    Get current authenticated user information

    HTTP Request

    curl -X GET \
      "https://api-eu.decathlon.net/activities/v1/auth/me"
      -H 'Authorization: Bearer XXXXXXX' \
      -H 'X-Api-Key: aaa-bbb-ccc'
    

    JSON response:

    {
      "id": "28cce8e0-2d57-4e54-8888-2fc69690aeeb",
      "type": "FED",
      "name": "John D",
      "photo": "//iam.subsidia.org/photos/users/JOHND01.jpg",
      "title": "Leader magasin",
      "site_id": "0070064800648",
      "mail": "hello@world.com",
      "site": {
        "id": 648,
        "name": "Magasin b'Twin village",
      }
    }
    

    This endpoint retrieves the information of the current authenticated user.


    Contributing

    Everyone is encouraged to help improve this project. We're open to feature requests, suggestions and new implementations.

    How to

    General public

    You can send us your suggestions, bug reports and feature requests to:

    Email: urmactivities@decathlon.com

    Core team

    Contributions are made using the Git Flow workflow.

    We want to respect the commit message format of Angular

    Once code is reviewed and approved, the changes are then merged into our master branch.

    1. Fork the Repository
    2. Create a [new-feature] branch.
    3. Implement your feature or bug fix.
    4. Add, commit, and push your changes.
      • git add -A
      • git commit -m "feat(...) add brief explanation of the implementation"
      • git push
    5. Submit a [Merge Request]https://gitlab.decathlon.net/sports-activities/api/merge_requests/new) through Gitlab

    Contribution examples


    Roadmap

    Beta: NOW available

    1.0: Sept 2018

    1.1: Janvier 2019

    1.2: Mars 2019