Reliafy

Files and photos

The connector’s tool calls carry JSON, not files. These two take bytes, so they’re on the API, the Python client and the command line only:

PUT/api/uploads/{upload_id}?t=…

Send a file to the single-use link from uploads create (at most 30 MB; the link’s t is the credential, no other sign-in). Then import it by its upload_id: datasets upload, uploads import_rbd, uploads import_excel or rbd upload_outage_log.

curl -X POST https://reliafy.com/api/v1/uploads/create -H "Authorization: Bearer $RELIAFY_TOKEN" \
  -H "Content-Type: application/json" -d '{"purpose": "rbd_import", "filename": "plant.xml"}'   # → url, upload_id
curl -X PUT --data-binary @plant.xml "UPLOAD_URL"
curl -X POST https://reliafy.com/api/v1/uploads/import_rbd -H "Authorization: Bearer $RELIAFY_TOKEN" \
  -H "Content-Type: application/json" -d '{"upload_id": "UPLOAD_ID"}'

reliafy import rbd plant.xml          # the same three steps
reliafy upload bearings.xlsx --name Bearings
  • PUT /api/uploads/{upload_id}?t=… (or POST with the raw body) — no sign-in: the link’s token is the credential. It works once and expires after 15 minutes. Answers { upload_id, size, sha256, detected_format }.
  • Errors: 404 (no such upload, or a wrong token), 409 (already used), 410 (expired), 413 (over the size limit — 30 MB at most), 429 (too many attempts).
  • Uploads are private to you, are never served back, and are deleted once imported or after an hour.
  • The upload URL points straight at Reliafy’s app service, which is fastest. Some sandboxes and corporate proxies refuse that host (for example CONNECT tunnel failed, response 403). For those, uploads create also returns url_fallback (with a ready curl_fallback): the same link on reliafy.com. Send the same PUT there once. It’s slower for large files. A PUT that a proxy refused never reached Reliafy, so the link is still unused.
POST/api/v1/maintenance/photos?target_id=…&caption=…

Reliafy Maintenance users: add a photo to a position, item, location or work order. The body is the image (JPEG, PNG, WebP or HEIC, at most 20 MB), or multipart with a file field. It’s cleaned and stripped of camera and location data, like a photo added in the app. Needs the write scope.

reliafy photo add IMG_*.jpg --to POSITION_ID --caption "Nameplate"
reliafy photo link PHOTO_ID --to LOCATION_ID     # show it there too
reliafy photo move PHOTO_ID --to POSITION_ID     # only there
reliafy photo unlink PHOTO_ID --from LOCATION_ID

From Python: rf.upload_dataset, rf.import_rbd, rf.import_excel and rf.add_photo (see the Python client).