Skip to content

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”
Terminal window
export FACTORY_URL=https://factory.paragonreflex.com
export FACTORY_PLANT=test-thej FACTORY_BOX=TEST1 FACTORY_BOX_TOKEN=<your key>
python3 examples/run_examples.py

Nine checks, about ten seconds. Each request and reply is saved to examples/last_run.json.

{
"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>"
}
Terminal window
python3 connector.py config.json

Append rows to results.csv and watch them leave. Pull the network: they wait on disk and go when it is back.

Terminal window
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.