1
Get the companies object id
Call List objects once and keep the
id of the object whose objectType is company. It does not change.2
Look the company up
Match on a stable value, such as the website, rather than on the name. A match comes back in
equals on text ignores case:data[0], with its id in _id.3
Update or create
If you found it, send only the changed fields:If not, create it:
4
Handle a duplicate
A company whose
website already exists answers 409 CONFLICT. Treat it as “already there”: look it up again and update it instead.A complete script
sync_companies.py

