Bulk Contact Importing Via API

stubh

Titanium Partner
Basic Certified
Joined
Dec 5, 2024
Messages
20
Reaction score
14
I am using the 3CX API for various things and one client asked if I can sync their contact list, via a CSV from another location.
There are a few things making this difficult from just a time perspective.
1. The list of contacts is large, several thousands.
2. Contacts might be updated and do not have an ID number in the original data that can be used as to reference these changes.
3. They want the data synced daily.

Since I cannot just check for updates, I have to bulk delete and readd daily.
I can sync the data, but since the script is doing them "one at a time", it is a bit slow.

There are API endpoints for bulk delete, but from the swagger I do not see anything on a bulk import or a import csv option, which would completely solve this issue since I could normalize the CSV data, and just dump that over in a single API call.

Anyone have any suggestions or done something similar in the past?
I know in the admin console under system->phonebook there is the option to import, I basically just need whatever that is doing to be accessible via the API.
 
F12 in the browser, Network tab, and do an import via the System > Phonebook page. See what it does and you can reproduce it.
 
Hello stubh,

I have found that API 'reading' the Phonebook contact this can be done in bulk.
However writing a a contact needs to be done by single entry, just like you have mentioned.

Found that the 3CX server does work amazing fast, making a copy from one 3CX, with around 12000 phonebook entry's to 3 other 3CX servers in way less than a minute or so (did not time it exactly), but works in the background daily, and on Web-Button push.

Working in the Cloud with nice backbone in the same datacenter, however we do not copy form another database or API, so we do not slow down by this, also the 3CX servers have generous specs, this all does matter.


Paulo
 
The platform I am in is necessarily not built for speed, I am batching it and having the system I am using do it with some parallel computing, and that seems to be working to do ~100 at a time.

Thank you for the feedback!
 
Last edited:
F12 in the browser, Network tab, and do an import via the System > Phonebook page. See what it does and you can reproduce it.
This was an incredible idea and I am putting this in my back pocket. There was a contact/PBX.importContacts endpoint it was using, took a good amount of trial and error, but I did get some test data to populate!
 

Members Online Now

No members online now.

Forum statistics

Threads
111,843
Messages
589,327
Members
164,679
Latest member
SamadMYK