via Ingestion API Endpoints

Ingesting via API Endpoints

As you define Data Models in your /datamodels folder, Moose will automatically generate ingestion points for you to send data to. Ingestion points are HTTP endpoints that you can send data to by making a POST request.

MooseTip:

You can inspect these endpoints by running moose ls in your terminal. Learn more

Sending Data to the Ingestion Endpoints

You can send data to these endpoints from your application, from a script, or from a tool like curl. Below are some snippets for sending data to the /ingest/UserActivity endpopint, which Moose automatically generated for the UserActivity Data Model (see the Data Models section)

Terminal
  curl -X POST \
    -H "Content-Type: application/json" \
    -d '{"eventId": "1234567890", "timestamp": "2019-01-01 00:00:01", "userId": "123456", "activity": "click"}' \
    http://localhost:4000/ingest/UserActivity
Make sure your development server is running

The dev server runs on localhost:4000 by default. You can start the server by running moose dev in your terminal. Learn more