Skip to content

Instantly share code, notes, and snippets.

@hkakutalua
Last active January 9, 2020 13:34
Show Gist options
  • Save hkakutalua/40ed865c9a2e73f6bdbc601fdb0c913b to your computer and use it in GitHub Desktop.
Save hkakutalua/40ed865c9a2e73f6bdbc601fdb0c913b to your computer and use it in GitHub Desktop.

Taksapp API Documentation

Sign-up

Sign-Up Request To Receive OTP

POST /api/v1/users/start-phone-sign-up

{
  "firstName": "Henrick",
  "lastName": "Kakutalua",
  "password": "123456",
  "phoneNumber": "+244912345678"
}

Responses

200 OK - OTP for Sign-Up Confirmation Already Sent

{
  "otpId": "..."
}

403 CONFLICT - Phone Number Already Registered

{
  "status": 403,
  "errors": 
  [
    {
      "source": "phoneNumber",
      "code": "phoneNumberAlreadyRegistered"
    }
  ]
}

Sign-Up OTP Confirmation

POST /api/v1/users/confirm-sign-up-with-otp

{
  "otpId": "...",
  "code": "123456"
}

Responses

201 - CREATED - Sign Up Confirmed and Account Created

{
  "firstName": "Henrick",
  "lastName": "Kakutalua",
  "phoneNumber": "+244912345678",
  "refreshToken": "...",
  "accessToken": "..."
}

404 - NOT FOUND - OTP Not Found

{
  "status": 404,
  "errors": 
  [
    {
      "source": "otpId",
      "code": "otpIdNotFound"
    }
  ]
}

400 - BAD REQUEST - Incorrect OTP Code

{
  "status": 400,
  "errors": 
  [
    {
      "source": "code",
      "code": "incorrectOtp"
    }
  ]
}

400 - BAD REQUEST - Expired OTP Code

{
  "status": 400,
  "errors": 
  [
    {
      "source": "code",
      "code": "expiredOtp"
    }
  ]
}

Taxi Request

Places Autocomplete Search

GET /api/v1/places/autocomplete?query='Univers'?locale=pt_PT

Responses

200 OK - OTP for Sign-Up Confirmation Already Sent

{
  "page": 1,
  "count": 10,
  "data": [
    {
      "id": "...",
      "primaryText": "...",
      "secondaryText": "...",
      "location": {
        "latitude": 0.475895,
        "longitude": 1.02983773
      }
    }
  ]
}

Route Between Two Geographic Points

GET /api/v1/routes?origin=13.356855,-8.933601&destination=13.309303,-8.919028

Responses

200 OK - Route Successfuly Determined

  • Distances are represented in meters.
  • Duration is represented in seconds.
{
  "origin": {
    "latitude": 13.356855,
    "longitude": -8.933601
  },
  "destination": {
    "latitude": 13.309303,
    "longitude": -8.919028
  },
  "routes": [{
    "bounds": {
      "northEast": {
        "latitude": ...,
        "longitude" ...
      },
      "southWest": {
        "latitude": ...,
        "longitude": ...
      }
    },
    "legs": [{
      "distance": 500,
      "duration": 300,
      "steps": [{
        "origin": ...,
        "destination": ...
      }]
    }]
  }]
}

200 OK - No Routes Found

{
  "origin": {
    "latitude": 13.356855,
    "longitude": -8.933601
  },
  "destination": {
    "latitude": 13.309303,
    "longitude": -8.919028
  },
  "routes": []
}

Taxi Fare Estimation

GET /api/v1/fares?distance=1200&duration=300&page=1&count=30

Responses

200 OK - Fare Estimated For Companies

{
  "page": 1,
  "count": 10,
  "data": [
    {
      "company": {
        "id": "...",
        "image": "asjjsytd...",
        "name": "..."
      },
      "currency": "AOA",
      "amount": 1200.34,
    }
  ]
}

200 OK - No Fares

{
  "page": 1,
  "count": 10,
  "data": []
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment