Quickstart
You need Python 3.10 or newer (stdlib only), the spec repo paragonreflex/reflex-factory-api, the connector repo
paragonreflex/reflex-plant-connector, and a box key for a test plant. Philip gives you the key: keep it on your
machine, never in git, chat or mail. One key per box.
1. Check the examples against the live cloud
Section titled “1. Check the examples against the live cloud”export FACTORY_URL=https://factory.paragonreflex.comexport FACTORY_PLANT=test-thej FACTORY_BOX=TEST1 FACTORY_BOX_TOKEN=<your key>python3 examples/run_examples.pyNine checks, about ten seconds. Each request and reply is saved to examples/last_run.json.
2. Point the connector at it
Section titled “2. Point the connector at it”{ "plant": "test-thej", "line": "W3", "station": "TEST1", "box": "TEST1", "source": "camera", "tz": "+07:00", "input": "results.csv", "input_kind": "csv", "field_map": {"UnitID": "unit", "Judge": "result", "Missing": "missing", "Time": "ts"}, "queue": "queue.db", "endpoint": "https://factory.paragonreflex.com/v1/lines", "token": "<your key>"}python3 connector.py config.jsonAppend rows to results.csv and watch them leave. Pull the network: they wait on disk and go when it is back.
3. Ask the record
Section titled “3. Ask the record”curl -s https://factory.paragonreflex.com/v1/ask \ -H "Authorization: Bearer $FACTORY_BOX_TOKEN" -H "Content-Type: application/json" \ -d '{"station":"TEST1","query":"last_good_unit"}'The answer names the unit and cites the line id it rests on.