Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

Mālama Labs API Examples

Version: 1.2.0 · Last updated: 2025-10-09

This repository contains practical examples for integrating with the Mālama Labs Data API (https://api.malamalabs.com/v1). Examples cover token management, event creation, evidence uploads, pagination, idempotency, retries with backoff, MQTT streaming, and a local queue for offline recovery.

Docs reference: https://docs.malamalabs.com/api

Structure

malama-api-examples/
├── README.md
├── LICENSE
├── .env.example
├── openapi/
│   └── malama-openapi.yaml
├── http/
│   ├── token.json.http
│   ├── list-projects.http
│   ├── create-event.http
│   └── upload-evidence.http
├── curl/
│   ├── get_token.sh
│   ├── list_projects.sh
│   ├── create_event.sh
│   └── upload_evidence.sh
├── postman/
│   └── Malama.postman_collection.json
├── python/
│   ├── requirements.txt
│   ├── quickstart.py
│   ├── create_event.py
│   ├── upload_evidence.py
│   ├── paginate_events.py
│   ├── mqtt_stream_handler.py
│   └── local_queue_processor.py
└── javascript/
    ├── package.json
    ├── quickstart.mjs
    ├── createEvent.mjs
    ├── uploadEvidence.mjs
    └── paginateEvents.mjs

Quick start (Python)

cd python
python -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
cp ../.env.example .env  # fill in values
python quickstart.py

Quick start (JavaScript)

cd javascript
npm i
cp ../.env.example .env  # fill in values
node quickstart.mjs

Notes

  • Use a single cached access token until expiry (60 min). Refresh on HTTP 401.
  • Include X-Idempotency-Key for POST retries.
  • Default rate limit: 1,000 req/min. Respect Retry-After on 429.
  • Evidence file limit: 10 MB each.

MIT License.

About

This repository contains practical examples for integrating with the Mālama Labs Data API (`https://api.malamalabs.com/v1`). Examples cover token management, event creation, evidence uploads, pagination, idempotency, retries with backoff, MQTT streaming, and a local queue for offline recovery. > Docs reference: https://docs.malamalabs.com/api

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages