Expanding datas¶
Ecovelo help you get expanded responses to your calls by using the expand request parameter. This parameter is available on all API requests. If the response of you request is supposed to contain the id of an object, it can be expanded.
expand works on GET Objects or Lists.
For example, if you get a trip you can expand all the positions, the start_station and the end_station`
curl -X GET "https://api.maas.ecovelo.mobi/trips/trip_nwh27rDXQPgw4iMF7pYBh5?expand=positions&expand=start_station&expand=end_station" -H "accept: application/json"
{
"agent": null,
"agent_email": null,
"agent_name": null,
"agent_phone_number": null,
"agent_role": null,
"amount": 200,
"amount_cyclist": 200,
"amount_discounted": 0,
"amount_live": 200,
"amount_organization": null,
"amount_refundable_max": 200,
"amount_refunded": 0,
"assist": null,
"assist_level": null,
"created": 1617187183,
"cyclist": "cycl_YAG4MmsNSU8r4W8T9atNgw",
"cyclist_email": "mathilde.chantal@ecovelo.com",
"cyclist_name": "Math CH",
"cyclist_phone_number": "+33667206999",
"cyclist_role": "cyclist",
"deposit": null,
"duration": 899,
"duration_total": 899,
"end_caddie": null,
"end_dock": "dock_TgSr8cUkWgqSykuroPojbW",
"end_dockless_area": null,
"end_name": "Showroom Ecovelo",
"end_photo": null,
"end_station": {
"created": 1589989459,
"docks": {
"data": [
{
"created": 1589989547,
"free": true,
"id": "dock_TgSr8cUkWgqSykuroPojbW",
"object": "dock",
"program": "preprod",
"rfid": "E004015092DAEDFE",
"station": "stn_9MBLkbA8vPV5hMvkvjbYHH",
"status": "open",
"vehicule": null,
"vehicule_number": null,
"vehicule_type": "vae"
},
{
"created": 1613725094,
"free": false,
"id": "dock_CbivtaMbHDDqkLxPgD7ErH",
"object": "dock",
"program": "preprod",
"rfid": "E004015092DADD6D",
"station": "stn_9MBLkbA8vPV5hMvkvjbYHH",
"status": "open",
"vehicule": "vhcl_KNatQ25EmTwp23qPxpSe9p",
"vehicule_number": 471,
"vehicule_type": "vae"
},
{
"created": 1613725687,
"free": true,
"id": "dock_kSWm3MaZ6Uc7jDrEUg3oYx",
"object": "dock",
"program": "preprod",
"rfid": "E0040150D75CFFC8",
"station": "stn_9MBLkbA8vPV5hMvkvjbYHH",
"status": "open",
"vehicule": null,
"vehicule_number": null,
"vehicule_type": "vae"
},
{
"created": 1589989557,
"free": true,
"id": "dock_oRDZAeRV4UP4pGe3knFWLA",
"object": "dock",
"program": "preprod",
"rfid": "E0040150786F44E1",
"station": "stn_9MBLkbA8vPV5hMvkvjbYHH",
"status": "open",
"vehicule": null,
"vehicule_number": null,
"vehicule_type": "vae"
},
{
"created": 1613723948,
"free": true,
"id": "dock_EFxX3CsSC6rxpiEUGtYB2q",
"object": "dock",
"program": "preprod",
"rfid": "E004015094AC7A9B",
"station": "stn_9MBLkbA8vPV5hMvkvjbYHH",
"status": "open",
"vehicule": null,
"vehicule_number": null,
"vehicule_type": "vae"
},
{
"created": 1589989566,
"free": true,
"id": "dock_eUcg9GwTTDdFaQDwbiztbH",
"object": "dock",
"program": "preprod",
"rfid": "E004015092DACC91",
"station": "stn_9MBLkbA8vPV5hMvkvjbYHH",
"status": "open",
"vehicule": null,
"vehicule_number": null,
"vehicule_type": "vae"
},
{
"created": 1613750863,
"free": true,
"id": "dock_WTTg7BdxhSSQTUj4FxnEmW",
"object": "dock",
"program": "preprod",
"rfid": "E0040150D75D0AB9",
"station": "stn_9MBLkbA8vPV5hMvkvjbYHH",
"status": "open",
"vehicule": null,
"vehicule_number": null,
"vehicule_type": "vae"
},
{
"created": 1613724013,
"free": true,
"id": "dock_ZusarBrQmBriZuxc2GbKR6",
"object": "dock",
"program": "preprod",
"rfid": "E004015094AC7F71",
"station": "stn_9MBLkbA8vPV5hMvkvjbYHH",
"status": "open",
"vehicule": null,
"vehicule_number": null,
"vehicule_type": "vae"
},
{
"created": 1613726685,
"free": false,
"id": "dock_eQsBTHkcDf8BUDPDmrsV6p",
"object": "dock",
"program": "preprod",
"rfid": "E00401507888BBA6",
"station": "stn_9MBLkbA8vPV5hMvkvjbYHH",
"status": "open",
"vehicule": "vhcl_vJdk8Zopor2Ka45ozraQKR",
"vehicule_number": 488,
"vehicule_type": "vae"
},
{
"created": 1601021954,
"free": false,
"id": "dock_UFucTGmdqRuSBikBAa35g2",
"object": "dock",
"program": "preprod",
"rfid": null,
"station": "stn_9MBLkbA8vPV5hMvkvjbYHH",
"status": "destroyed",
"vehicule": null,
"vehicule_number": null,
"vehicule_type": "vae"
}
],
"has_more": false,
"object": "list",
"total": 10,
"total_count": 9,
"total_free": 7,
"total_vehicules": 4
},
"favorite": null,
"id": "stn_9MBLkbA8vPV5hMvkvjbYHH",
"name": "Showroom Ecovelo",
"object": "station",
"position": {
"latitude": "47.210912084216574",
"longitude": "-1.5767988241540376"
},
"program": "preprod",
"statistics": {
"docks": {
"free": 7,
"status": {
"broken": 0,
"closed": 0,
"destroyed": 1,
"draft": 0,
"open": 9
},
"total": 10,
"type": {
"boat": {
"free": 0,
"status": {
"broken": 0,
"closed": 0,
"destroyed": 0,
"draft": 0,
"open": 0
},
"total": 0
},
"classic": {
"free": 0,
"status": {
"broken": 0,
"closed": 0,
"destroyed": 0,
"draft": 0,
"open": 0
},
"total": 0
},
"scooter": {
"free": 0,
"status": {
"broken": 0,
"closed": 0,
"destroyed": 0,
"draft": 0,
"open": 0
},
"total": 0
},
"vae": {
"free": 7,
"status": {
"broken": 0,
"closed": 0,
"destroyed": 1,
"draft": 0,
"open": 9
},
"total": 10
}
}
},
"vehicules": {
"electrical": 4,
"status": {
"destroyed": 0,
"lost": 0,
"maintenance": 1,
"maj": 1,
"ready": 0,
"service": 2,
"stock": 0
},
"total": 4,
"type": {
"boat": 0,
"classic": 0,
"scooter": 0,
"vae": 4
}
}
},
"status": "open",
"vehicules": {
"data": [
"vhcl_5agr5XFQ2Hxu9c6E6MXpC4",
"vhcl_KNatQ25EmTwp23qPxpSe9p",
"vhcl_ErduWhKTY6qnoxvdyrNHVZ",
"vhcl_vJdk8Zopor2Ka45ozraQKR"
],
"has_more": false,
"object": "list",
"total": 4
}
},
"end_timestamp": 1617188082,
"error_code": null,
"error_message": null,
"facture": "in_1Ib27RBOtJNunvBHd5DP4DfY",
"forfait": "forf_RwrGaDVPjGGEvceS58JZaZ",
"forfait_name": "Flash",
"id": "trip_nwh27rDXQPgw4iMF7pYBh5",
"invoice_item": "ii_1Ib1hGBOtJNunvBHvlZhb3KS",
"number": 13304,
"object": "trip",
"organization": null,
"organization_percent": null,
"origin": "web",
"payment_status": "paid",
"pin": "9326",
"positions": {
"data": [
{
"agent_role": null,
"created": 1617188083,
"cyclist_role": "cyclist",
"id": "pos_LtWwfReHTjGvpHSarDDC5k",
"latitude": "47.21099342465441",
"longitude": "-1.57684747488892",
"object": "position",
"organization": null,
"program": "preprod",
"trip": "trip_nwh27rDXQPgw4iMF7pYBh5",
"vehicule": "vhcl_ErduWhKTY6qnoxvdyrNHVZ"
},
{
"agent_role": null,
"created": 1617188075,
"cyclist_role": "cyclist",
"id": "pos_bd2A2XW9jVcPA9sxhLu82w",
"latitude": "47.211004",
"longitude": "-1.577524",
"object": "position",
"organization": null,
"program": "preprod",
"trip": "trip_nwh27rDXQPgw4iMF7pYBh5",
"vehicule": "vhcl_ErduWhKTY6qnoxvdyrNHVZ"
},
{
"agent_role": null,
"created": 1617188036,
"cyclist_role": "cyclist",
"id": "pos_Jrp9o72bpYoBAToyioEvPV",
"latitude": "47.211738",
"longitude": "-1.576393",
"object": "position",
"organization": null,
"program": "preprod",
"trip": "trip_nwh27rDXQPgw4iMF7pYBh5",
"vehicule": "vhcl_ErduWhKTY6qnoxvdyrNHVZ"
},
{
"agent_role": null,
"created": 1617188015,
"cyclist_role": "cyclist",
"id": "pos_Tdg4Bk5RmDjE47tUDjAzoo",
"latitude": "47.212773",
"longitude": "-1.571232",
"object": "position",
"organization": null,
"program": "preprod",
"trip": "trip_nwh27rDXQPgw4iMF7pYBh5",
"vehicule": "vhcl_ErduWhKTY6qnoxvdyrNHVZ"
}
],
"has_more": false,
"object": "list",
"total": 4
},
"price_rent": 200,
"price_total": 200,
"program": "preprod",
"refunded": false,
"simultaneous_rent_counter": null,
"simultaneous_reservation_counter": null,
"start_caddie": null,
"start_dock": "dock_WTTg7BdxhSSQTUj4FxnEmW",
"start_dockless_area": null,
"start_name": "Showroom Ecovelo",
"start_station": {
"created": 1589989459,
"docks": {
"data": [
{
"created": 1589989547,
"free": true,
"id": "dock_TgSr8cUkWgqSykuroPojbW",
"object": "dock",
"program": "preprod",
"rfid": "E004015092DAEDFE",
"station": "stn_9MBLkbA8vPV5hMvkvjbYHH",
"status": "open",
"vehicule": null,
"vehicule_number": null,
"vehicule_type": "vae"
},
{
"created": 1613725094,
"free": false,
"id": "dock_CbivtaMbHDDqkLxPgD7ErH",
"object": "dock",
"program": "preprod",
"rfid": "E004015092DADD6D",
"station": "stn_9MBLkbA8vPV5hMvkvjbYHH",
"status": "open",
"vehicule": "vhcl_KNatQ25EmTwp23qPxpSe9p",
"vehicule_number": 471,
"vehicule_type": "vae"
},
{
"created": 1613725687,
"free": true,
"id": "dock_kSWm3MaZ6Uc7jDrEUg3oYx",
"object": "dock",
"program": "preprod",
"rfid": "E0040150D75CFFC8",
"station": "stn_9MBLkbA8vPV5hMvkvjbYHH",
"status": "open",
"vehicule": null,
"vehicule_number": null,
"vehicule_type": "vae"
},
{
"created": 1589989557,
"free": true,
"id": "dock_oRDZAeRV4UP4pGe3knFWLA",
"object": "dock",
"program": "preprod",
"rfid": "E0040150786F44E1",
"station": "stn_9MBLkbA8vPV5hMvkvjbYHH",
"status": "open",
"vehicule": null,
"vehicule_number": null,
"vehicule_type": "vae"
},
{
"created": 1613723948,
"free": true,
"id": "dock_EFxX3CsSC6rxpiEUGtYB2q",
"object": "dock",
"program": "preprod",
"rfid": "E004015094AC7A9B",
"station": "stn_9MBLkbA8vPV5hMvkvjbYHH",
"status": "open",
"vehicule": null,
"vehicule_number": null,
"vehicule_type": "vae"
},
{
"created": 1589989566,
"free": true,
"id": "dock_eUcg9GwTTDdFaQDwbiztbH",
"object": "dock",
"program": "preprod",
"rfid": "E004015092DACC91",
"station": "stn_9MBLkbA8vPV5hMvkvjbYHH",
"status": "open",
"vehicule": null,
"vehicule_number": null,
"vehicule_type": "vae"
},
{
"created": 1613750863,
"free": true,
"id": "dock_WTTg7BdxhSSQTUj4FxnEmW",
"object": "dock",
"program": "preprod",
"rfid": "E0040150D75D0AB9",
"station": "stn_9MBLkbA8vPV5hMvkvjbYHH",
"status": "open",
"vehicule": null,
"vehicule_number": null,
"vehicule_type": "vae"
},
{
"created": 1613724013,
"free": true,
"id": "dock_ZusarBrQmBriZuxc2GbKR6",
"object": "dock",
"program": "preprod",
"rfid": "E004015094AC7F71",
"station": "stn_9MBLkbA8vPV5hMvkvjbYHH",
"status": "open",
"vehicule": null,
"vehicule_number": null,
"vehicule_type": "vae"
},
{
"created": 1613726685,
"free": false,
"id": "dock_eQsBTHkcDf8BUDPDmrsV6p",
"object": "dock",
"program": "preprod",
"rfid": "E00401507888BBA6",
"station": "stn_9MBLkbA8vPV5hMvkvjbYHH",
"status": "open",
"vehicule": "vhcl_vJdk8Zopor2Ka45ozraQKR",
"vehicule_number": 488,
"vehicule_type": "vae"
},
{
"created": 1601021954,
"free": false,
"id": "dock_UFucTGmdqRuSBikBAa35g2",
"object": "dock",
"program": "preprod",
"rfid": null,
"station": "stn_9MBLkbA8vPV5hMvkvjbYHH",
"status": "destroyed",
"vehicule": null,
"vehicule_number": null,
"vehicule_type": "vae"
}
],
"has_more": false,
"object": "list",
"total": 10,
"total_count": 9,
"total_free": 7,
"total_vehicules": 4
},
"favorite": null,
"id": "stn_9MBLkbA8vPV5hMvkvjbYHH",
"name": "Showroom Ecovelo",
"object": "station",
"position": {
"latitude": "47.210912084216574",
"longitude": "-1.5767988241540376"
},
"program": "preprod",
"statistics": {
"docks": {
"free": 7,
"status": {
"broken": 0,
"closed": 0,
"destroyed": 1,
"draft": 0,
"open": 9
},
"total": 10,
"type": {
"boat": {
"free": 0,
"status": {
"broken": 0,
"closed": 0,
"destroyed": 0,
"draft": 0,
"open": 0
},
"total": 0
},
"classic": {
"free": 0,
"status": {
"broken": 0,
"closed": 0,
"destroyed": 0,
"draft": 0,
"open": 0
},
"total": 0
},
"scooter": {
"free": 0,
"status": {
"broken": 0,
"closed": 0,
"destroyed": 0,
"draft": 0,
"open": 0
},
"total": 0
},
"vae": {
"free": 7,
"status": {
"broken": 0,
"closed": 0,
"destroyed": 1,
"draft": 0,
"open": 9
},
"total": 10
}
}
},
"vehicules": {
"electrical": 4,
"status": {
"destroyed": 0,
"lost": 0,
"maintenance": 1,
"maj": 1,
"ready": 0,
"service": 2,
"stock": 0
},
"total": 4,
"type": {
"boat": 0,
"classic": 0,
"scooter": 0,
"vae": 4
}
}
},
"status": "open",
"vehicules": {
"data": [
"vhcl_5agr5XFQ2Hxu9c6E6MXpC4",
"vhcl_KNatQ25EmTwp23qPxpSe9p",
"vhcl_ErduWhKTY6qnoxvdyrNHVZ",
"vhcl_vJdk8Zopor2Ka45ozraQKR"
],
"has_more": false,
"object": "list",
"total": 4
}
},
"start_timestamp": 1617187183,
"status": "completed",
"termination_requested_timestamp": 1617188082,
"termination_requests": {
"data": [
{
"cancelled_at": null,
"cancelled_reason": null,
"created": 1617188083,
"description": "vehicule_on_dock | Le véhicule a été rattaché à une borne.",
"id": "treq_K9TkbvpjnWXiGnSLfCdYut",
"latitude": null,
"longitude": null,
"object": "termination_request",
"origin": "system",
"photo": null,
"status": "terminated",
"trip": "trip_nwh27rDXQPgw4iMF7pYBh5"
},
{
"cancelled_at": null,
"cancelled_reason": null,
"created": 1617188082,
"description": "boitier_fdl | Le véhicule a terminé son trajet.",
"id": "treq_GP4fhZ8fGYq2GwXhgSt5bw",
"latitude": null,
"longitude": null,
"object": "termination_request",
"origin": "system",
"photo": null,
"status": "accepted",
"trip": "trip_nwh27rDXQPgw4iMF7pYBh5"
}
],
"has_more": false,
"object": "list",
"total": 2
},
"time_discounted": 0,
"user": "cycl_YAG4MmsNSU8r4W8T9atNgw",
"user_email": "mathilde.chantal@ecovelo.com",
"user_name": "Math CH",
"user_phone_number": "+33667206999",
"user_role": "cyclist",
"vehicule": "vhcl_ErduWhKTY6qnoxvdyrNHVZ",
"vehicule_number": 472,
"vehicule_type": "vae"
}