Automate uploads
Dragging an export into the workspace is fine once. If your solution changes every week, you want the server to do it. FM Fathom has an endpoint for exactly that: send it the XML, or a link to the XML, and it parses the file in the background the same way a drag-and-drop does.
What you need
- A file already created in your workspace (the endpoint refreshes files; it does not create them)
- The Upload XML capability on your account
- Your access key for the client. Open the file's card in the workspace and click Automate; the key is shown there, or you can generate one. One key per user per client: it covers every file under that client, and it is the same key that connects AI clients to the solution.
- A machine with
curl. FileMaker Server on Linux and macOS has it, and on Windows Server 2019 and latercurl.exeis built in.
The commands
The workspace's Automate panel prints these with your host, key, and slugs already filled in. Copy from there rather than retyping. Shown here with placeholders.
Send the file directly. The XML streams up as the request body; nothing is held in memory on either side.
curl -sS -X POST "https://fathom.fmfathom.com/api/ingest?client=CLIENT&file=FILE&filename=Export.xml" \
-H "x-api-key: YOUR_ACCESS_KEY" \
-H "Content-Type: application/xml" \
--data-binary @/path/to/Export.xml
Or send a link. If your export already lands somewhere reachable over HTTPS (an S3 bucket with a presigned link, a web server), hand over the address and FM Fathom downloads it.
curl -sS -X POST "https://fathom.fmfathom.com/api/ingest" \
-H "x-api-key: YOUR_ACCESS_KEY" \
-H "Content-Type: application/json" \
-d '{"file_slug": "FILE", "xml_path": "https://example.com/Export.xml"}'
Both answer at once with HTTP 202 and a status_url. The parse then runs for a few seconds to a few minutes, depending on the size of the export.
Check the result.
curl -sS -H "x-api-key: YOUR_ACCESS_KEY" \
"https://fathom.fmfathom.com/api/ingest/status?client=CLIENT&file=FILE"
status is running, success, or failed, with the counts of what was parsed and, on failure, the reason. The file's workspace card shows the same thing.
The panel's Reference tab has the full endpoint detail: request shapes, the responses, and every error reply with what it means.
Running it on a schedule
Put either command in a scheduled task on the server that holds the export, right after the FileMaker script that saves it. On FileMaker Server that is a Script Sequence: the FileMaker script that runs Save a Copy as XML first, then a system script that runs curl. Delete the local copy once you get a 202 back, and keep the schedule off peak hours; exports can be several hundred megabytes.
Where the key may reach
An access key is tied to one client. It can refresh any file under that client and nothing else, and it stops working the moment it is revoked on the Connect page or the account loses access to the client. Generating a new key replaces the old one everywhere, including any AI client that used it.
Links you send must be public HTTPS addresses. FM Fathom will not fetch from private or internal networks.
Related
- Export your solution as XML: the export the schedule produces
- Upload server logs: the other half of the picture
- Troubleshooting: when the upload is refused