Building Your Own Data Lake

ℹ️Covered in this guide
Why you should build your own data lake
Step-by-step guide to augment locations
Get support
Related Recipes

Why you should build your own data lake

Data is the most crucial asset these days. Data Lakes allow various roles in your organization like data scientists, data developers, and business analysts to access data with their preferred analytic tools and frameworks. The ability to harness more data, from more sources, in less time, and empower users to collaborate and analyze data in different ways leads to better, faster decision-making.

This section covers the details of receiving augmented trip data using a callback URL.

Step-by-step guide to augment locations

Initial configuration

To use the augmented(context) trip data callback you need to either:

  • declare what is your context_callback and do you want to use it before starting to consume our API
  • update your organization information through a call to our API and set the context_callback_url and enable it.

You can do this with the following command:

curl --location --request PATCH 'https://api.motion-s.com/platform/v1/organizations/' \
    --header 'X-API-KEY: <API-Key>' \
    --header 'Content-Type: application/json' \
    --data-raw '{
        "context_callback_url": "https://<your_server_endpoint>",
        "context_callback_used": true,
    }'

When you have declared your callback URL, every time you submit your trips successfully, you will receive POST request to your context_callback_url containing the augmented trip information as a json body.

Code example of an endpoint which can receive this callback using FastAPI:

from fastapi import FastAPI, Request
import uvicorn

app = FastAPI()

@app.post("/")
async def augmented_data_callback(request: Request):
    data = request.json()

Step-by-step guide to obtain mobility profiles

To use mobility callbacks first you need to:

  • implement an endpoint that to be able to receive the mobility profile.
  • declare the endpoint (profile_callback_url) in your organization settings.

You can do this with the following command:

curl --location --request PATCH 'https://api.motion-s.com/platform/v1/organizations/' \
    --header 'X-API-KEY: <API-Key>' \
    --header 'Content-Type: application/json' \
    --data-raw '{
        "profile_callback_url": "https://<your_server_endpoint>",
        "profile_callback_used": true
    }'

After you have declared your callback URL, every time you submit a trip, you will receive a POST request to your profile_callback_url containing the profiled trip information as a json body.

Code example of an endpoint which can receive this callback using FastAPI:

from fastapi import FastAPI, Request
import uvicorn

app = FastAPI()

@app.post("/")
async def profiled_data_callback(request: Request):
    data = request.json()

Get support

Do you have trip data and would like to obtain augmented and profiled data in JSON?
We support you in building your data lake by setting up a number of callbacks. Contact the team for more information and support.