WebFones Documentation

Administrator Guide

Menu

Switch to User Guide

Contact API Tutorial

This tutorial provides sample PHP code to demonstrate how to connect and synchronize a CRM system with the WebFones contact platform. It shows how to store contact records in WebFones using an external-id, which enables future updates to be synced reliably. A versioning system is also used, allowing your middleware to detect and retrieve updated contact records whenever changes occur.

The API requires an API Key which you can find on your account’s API Prefereces page.

Fetching Contacts and Contact Record Changes

The fetch_contact_changes.php fetches all the records in the database and then monitors changes by polling every 10 seconds.

php fetch_contact_changes.php "API_KEY"

This will list the uuid primary key used to identify each contact record. That can be used in the next step.

Connecting your CRM records with WebFones Contact Records

You can update or insert contact records into WebFones by iterating through your CRM contacts and linking each one using its unique CRM ID.

php set_extension_id.php "API_KEY" --uuid "RECORD UUID" --extension-id "CRM ID"

Updating the WebFones Contact Record

When the record in the CRM changes, the data can be moved to the WebFones database by using the CRM ID stored in the external ID column. We recommend using the API to update the contact record. Here is an example of updating a contact record using the example php.

php update_contact.php "API_KEY" --extension-id "CRM ID" --firstname "Joe" --lastname "Smith"

AI Documentation Assistant

Suggested Questions

How do I set up call forwarding? What is a ring group? How do I check voicemail? How do I add a new extension?
Thinking...