How to Develop a 3CX Plugin
On this topic
- Microsoft Visual Studio 2015
- 3CX Client for Windows V15
Download the 3CX VS Template
- Open Visual Studio and go to “Tools > Extensions and Updates > Online.”
- In the search box enter “3CX Integration Template.”
- Download the template and follow the installation instructions. When done, the template can be used to easily create new projects.
Creating a new project
In this example we are going to create a project to make a plugin for a crm named ABCcrm.
- Open the Visual Studio and go to “File > New > Project.”
- Select “Visual C#” and then “3CX Integration Template.” This will launch the 3CX Integration wizard.
- Select the type of authentication your plugin requires. There are 3 types:
- No Authentication - No authentication is required
- Basic Authentication - Relies on a username and password or API Key
- OAuth2 Authentication - Uses OAuth2 authentication protocol
- Select the type of web service used by the plugin: REST or SOAP.
- Enter the URL used by your CRM or 3rd party software that looks for and finds a matching contact. Example: https://abccrm.com/contacts/query?callerid=[CALLERID].
- Enter the URL used by your CRM that opens the matching contact record in a browser. Example: https://abccrm.com/contacts?contactid=[CONTACTID].
- Enter the URL used by your CRM to create a new contact. Example: https://abccrm.com/contacts/contact.json?phone=[CALLERID]
- If your CRM supports journaling enter the URL. Example: https://abccrm.com/contacts?contactid=[CONTACTID]¬e=[NOTE]
- Finally, press the “Finish” button to create your project skeleton.
When the plugin is ready, you need to upload it to the 3CX Management Console. To do this you need to create a package:
- Select all the files from the project folder and add them into a ZIP file with the name of the plug-in, for example abccrm.zip.
- Open the 3CX Management Console and go to “Settings > CRM Integration.” Press the “Add” button to upload the ZIP created in the previous step. The new plug-in will be uploaded to the 3CX server.
- After we need to assign this plugin to selected users so it can be integrated into their 3CX client. Go to “Extensions > edit extension > Integration > Enable Integration” and select “abccrm.zip” from the dropdown menu. Press “OK” to save.
- Go to the “Phones” tab, select the extensions and press “Reprovision.” After the 3CX client reprovisions, the end user must restart the client (Settings > Exit Client).
- To confirm that your plugin is loaded correctly, open your 3CX client, go to “Settings > Advanced Settings > Integration” and you should see your plugin listed there. If you do not see your plugin, go to “%appdata%\3CXPhone for Windows\Logs” and in that location there will be logs related to the plugin.
Making New Versions
At one point, you will need to make a fix, implement a new feature or make improvements to your plugin. A new build needs to be made and uploaded to the 3CX Management Console.
- Open your project in Visual Studio.
- Go to “Build > Build Solution.” This process will increment the version number so that the 3CX clients can detect that the uploaded plugin is a newer version.
- Repeat the steps mentioned in the section Deploying the Plugin.