Sync documents from your ERP or your systems with the BrainBox API

How to make the documents your systems generate (orders, invoices, reports) land in a Box on their own, organized in folders and ready to be asked.

Lesson 2 of 5 · 2:08

What it covers

Every night your ERP generates purchase orders and invoices. With the API, an integration uploads them to a Box: it finds or creates the Box, creates the folders, uploads each file and skips what's already there. The next day, your team asks BrainBox about any order, with citations.

Frequently asked questions

›How do I upload a file through the API?

With POST /boxes/{id}/upload: multipart with the file field (up to 4 MB) or JSON with an HTTPS url (up to 2 GB). Both accept fileName and folderId.

›When is it ready to be asked?

The same call processes it fully: when it responds, the file is already indexed.

›How do I avoid uploading the same thing twice?

List the Box's files with GET /boxes/{id}/files and upload only what's new.

Transcript

0:00By hand, every day

Every morning, Camila downloads the purchase orders from the ERP and uploads them to BrainBox one by one. A system can do that, on its own, every night.

0:12The flow

Syncing takes four steps. Find the Box, or create it if it doesn't exist. See which files it already has, so nothing repeats. Create one folder per document type. And upload each file, which gets indexed in the same call.

0:30The code

In code it looks like this. Whatever is already in the Box is skipped. And each new file is uploaded with its folder. Three files, each one indexed in a few seconds. And if a file is bigger than four megabytes, you pass an address, and BrainBox downloads it, up to two gigabytes.

0:51In Celtara Hub

In Celtara Hub, this is last night's export: two orders and an invoice. Sync now. Look at the log: it looks for the Box, it doesn't exist, it creates it. It creates the folders and uploads each file. Done, in BrainBox. And if it runs again? Whatever was already there is skipped. You can schedule it every night without fear of duplicates.

1:19In BrainBox

In BrainBox the new Box appears. Open it: invoices and orders, each in its folder. Camila asks: which orders are pending, and when is the invoice due? One twenty-one is pending; one eighteen is in transit; and the invoice is due October nineteenth. Every fact cites the document the ERP uploaded.

1:44Recap

To recap: the integration finds or creates the Box and its folders, uploads only what's new, directly or by URL, and as soon as it finishes, it's ready to be asked. Camila got her mornings back. What your systems generate, BrainBox knows.