No box, no code: let the camera or the recorder send its pictures
A network camera can post a JPEG to an HTTPS address; a recorder can upload by FTP. How an upload URL and an FTP login turn existing equipment into a monitored camera, and where it stops.
The cheapest piece of equipment to install on a customer’s site is none. No mini PC to ship, no program to keep up to date, no visit when it stops answering.
Many sites already have what is needed. A network camera has a small computer inside and, in its settings, a rule that says “when this happens, send a picture there”. A recorder has an FTP upload page that nobody has opened since it was installed. The Camly API can be the “there” for both.1
The camera sends: an upload URL
Create a push camera and attach a monitor to it, as for any camera. Then ask for its upload URL:
curl -X POST https://api.camly.ai/v1/cameras/cam_123/upload-url \
-H "Authorization: Bearer $CAMLY_API_KEY"
{
"object": "upload_url",
"camera": "cam_123",
"last4": "x9Qz",
"token": "cmly_up_...x9Qz",
"url": "https://api.camly.ai/v1/upload/cmly_up_...x9Qz",
"basic_auth_url": "https://api.camly.ai/v1/upload"
}
The URL is shown once. It works for that camera only and can do one thing: receive pictures. Whoever holds it cannot read your data or change anything.
In the camera’s own web page, add the URL as an HTTPS recipient, then make an event rule (motion, line crossing, a timer) that sends a picture to it. The menu names vary with the brand and the firmware; the documentation gives the usual places for the common brands.1
Before touching the camera, do what it will do, from your own computer:
curl -X POST "$UPLOAD_URL?trigger=motion" \
-H "Content-Type: image/jpeg" \
--data-binary @frame.jpg
If that returns a check, the Camly side is right, and anything that goes wrong afterwards is in the camera’s settings.
Three details of the upload URL
Mark motion pictures as motion. In a rule fired by an event, add ?trigger=motion to the address. Monitors with motion turned off then skip those pictures. A timer rule sends without it.
Cameras disagree on formats, and that is fine. The URL accepts a raw JPEG body, a multipart/form-data form with the picture under any field name, or a multipart/mixed body, sent with POST or PUT. A message with no picture in it, such as a heartbeat, is answered 200 and not charged.
Prefer user name and password when the camera offers it. The token is part of the address, so it can appear in logs along the way. A camera that asks for a user name and a password instead of a full address can use the basic_auth_url, any user name, and the token as the password. The token then stays out of the address.
The recorder sends: an FTP login
A recorder (DVR or NVR) cannot run a program of yours and usually cannot call an HTTPS address. Nearly all can upload snapshots by FTP, on a timer or on motion.
curl -X POST https://api.camly.ai/v1/recorders \
-H "Authorization: Bearer $CAMLY_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name": "Shop NVR"}'
The answer carries an FTP host, a port, a user name and a password, the password shown once. Type them into the recorder’s FTP settings, leave the remote folder empty, turn on snapshot upload for the channels to watch, and use the recorder’s Test button.
The recorder writes each picture under a path that names its channel, and Camly reads the channel from that path. A channel that has sent a picture appears in the recorder’s channels. Its pictures are ignored, and nothing is charged, until you add it as a camera:
curl -X POST https://api.camly.ai/v1/cameras \
-H "Authorization: Bearer $CAMLY_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name": "Checkout", "recorder": "rec_...", "channel": 3}'
This is deliberate. A sixteen-channel recorder does not become sixteen billed cameras because someone ticked a box: you choose the channels worth watching.
Who decides the pace
A camera or a recorder does not read the API’s answers, so it cannot follow the pace a monitor asks for. The monitor’s schedule decides instead.
- Pictures that arrive within
min_interval_secondsof the last check are skipped and not charged. A camera that sends a burst of ten on one motion event costs one check. - Set the device’s timer to the monitor’s
max_interval_seconds. A camera that sends nothing for three times that long is marked offline, with acamera.offlineevent.
The first point removes the usual fear with event-driven uploads, that a tree in the wind will empty the balance overnight.
Where it stops
This way in has honest limits, and it is better to know them before promising something to a customer.
| Limit | Why | What to do |
|---|---|---|
| No questions about the past | The device keeps no archive for Camly | Use the Camly Bridge when you need to search past pictures |
| Old firmware without HTTPS | The upload URL is HTTPS only | Use a gateway of yours or the Bridge |
| FTP is not encrypted | The protocol sends password and pictures in clear | Turn on FTPS (explicit TLS) when the recorder offers it |
| Recorder snapshots are often small | Many recorders upload a reduced picture | For text or small details, prefer the Bridge |
| A path format that is not recognised | Brands name their folders differently | The recorder’s unrecognised field shows the path: send it to support and the format is added |
On the third line: the FTP login can only send pictures to that recorder’s cameras. Nothing can be read or downloaded with it, and the FTP server keeps no picture. The exposure is the transit, which is why FTPS is worth turning on.
When this is the right choice
A shop with one recorder and a question about the stock room door. A car park with two cameras on a mast and no cabinet to put a computer in. A customer whose IT department will not let a new machine onto the network but has no objection to an outgoing rule in a camera that is already there.
In each case the alternative is a site visit and a box. The other ways in, and what each one gives, are compared in five ways to get a picture to the API.
Sources
- Camly API, all guides as plain text: Let the camera send, Connect a recorder. platform.camly.ai
- Camly API contract (OpenAPI). api.camly.ai