Exemples

Cette page regroupe des exemples de requêtes sur lesquels vous pouvez vous baser pour développer votre application.

Lister les taxis
  curl 'api.taxi/taxis/?lat=48.8&lon=2.3' \
    -X GET                                \
    -H "Accept: application/json"         \
    -H "X-VERSION: 2"                     \
    -H "X-API-KEY: XXX"
Créer une demande de course
  curl 'api.taxi/hails/:hail_id/'                 \
    -X POST                                       \
    -H "X-VERSION: 2"                             \
    -H "Accept: application/json"                 \
    -H "Content-Type: application/json"           \
    -H "X-API-KEY: XXX"                           \
    -d '
{
  "data": [{
    "customer_address": "customer address",
    "customer_id": "0656435678",
    "customer_lat": 48.8,
    "customer_lon": 2.3,
    "customer_phone_number": "0656435678",
    "operateur": "operator",
    "taxi_id": "taxi_id"
  }]
}'
Changer le statut d'un taxi à accepted_by_customer
  curl 'api.taxi/hails/hail_id/'           \
    -X PUT                                 \
    -H "X-VERSION: 2"                      \
    -H "Accept: application/json"          \
    -H "Content-Type: application/json"    \
    -H "X-API-KEY: XXX"                    \
    -d '
{
  "data": [{
    "status": "accepted_by_customer"
  }]
}'

Exemples utiles pour les opérateurs

Libérer un taxi
  curl 'api.taxi/taxis/:taxi_id/'       \
    -X PUT                              \
    -H "X-VERSION: 2"                   \
    -H "Accept: application/json"       \
    -H "Content-Type: application/json" \
    -H "X-API-KEY: XXX"                 \
    -d '
{
  "data": [{
    "status": "free"
  }]
}'
Changer le statut d'un taxi à received_by_taxi
  curl 'api.taxi/hails/:hail_id/'       \
    -X PUT                              \
    -H "X-VERSION: 2"                   \
    -H "Accept: application/json"       \
    -H "Content-Type: application/json" \
    -H "X-API-KEY: XXX"                 \
    -d '{
"data": [{
    "status": "received_by_taxi"
  }]
}'