Bitrix24 tips and updates

How To: Lead creation from external services

Ann Slyshkina
April 26, 2013
Last updated: December 11, 2018
This post is outdated. Please use new Bitrix24 web forms instead - https://www.bitrix24.com/about/blogs/updates/meet-new-bitrix24-CRM-forms.php

Suppose you have a form on a site that visitors can fill out. Using the REST API of Bitrix24, you can use the data received in this form to create a lead in the CRM.
fbf4ccb2ffe224d57b1ab0a21376c7ae.gif
The REST API can be used to only to import leads in the CRM. Soon, the API will be capable of importing other CRM entities (contacts, companies and deals).

Creating leads in the CRM from external services can be done using the special-purpose page:
"your_name".bitrix24.com/crm/configs/import/lead.php

For a lead to be added to the CRM you must:
  1. Call this page with a GET or POST method
  2. Pass at least 3 required parameters: login and password of the user who is the creator of the lead, and the title of the lead.
The script will return a JSON-object with the parameters code and error_message.

Table 1: Response codes and descriptions
Code Description
400 Parameters missing or parameters invalid
403 Authorization or access error
201 Lead added
Table 2: Parameters
Parameter Type Description
LOGIN* String Login
PASSWORD* String Password
TITLE* String Title
COMPANY_TITLE String Company Name
NAME String First Name
LAST_NAME String Last Name
SECOND_NAME String Second Name
POST String Position
ADDRESS String Address
COMMENTS String Comment
SOURCE_DESCRIPTION String Source Description
STATUS_DESCRIPTION String Status Description
OPPORTUNITY Double Opportunity
CURRENCY_ID String Currency
PRODUCT_ID String Product
SOURCE_ID String Source
STATUS_ID String Lead Status
ASSIGNED_BY_ID Int Responsible
PHONE_WORK String Work Phone
PHONE_MOBILE String Mobile
PHONE_FAX String Fax
PHONE_HOME String Home Phone
PHONE_PAGER String Pager
PHONE_OTHER String Other Phone
WEB_WORK String Corporate Site
WEB_HOME String Personal Site
WEB_FACEBOOK String Facebook Page
WEB_LIVEJOURNAL String LiveJournal Page
WEB_TWITTER String Twitter Account
WEB_OTHER String Other Site
EMAIL_WORK String Work E-mail
EMAIL_HOME String Personal E-mail
EMAIL_OTHER String Other E-mail
IM_SKYPE String Skype
IM_ICQ String ICQ
IM_MSN String MSN/Live!
IM_JABBER String Jabber
IM_OTHER String Other Messenger
* - required parameter

The STATUS_ID , SOURCE_ID , CURRENCY_ID, and PRODUCT_ID parameters are selected from a corresponding directory of the CRM.

Below are tables with value sets of these parameters after installation of the module.
Important: values can be changed by the intranet administrator or deleted.

Table 3: STATUS_ID – Lead Statuses
Value Description
NEW Unassigned
ASSIGNED Responsible Assigned
DETAILS Waiting for Details
CANNOT_CONTACT Cannot Contact
IN_PROCESS In Progress
ON_HOLD On Hold
RESTORED Restored
CONVERTED Converted
JUNK Junk Lead
Table 4: SOURCE_ID – Sources
Value Description
SELF Personal Contact
PARTNER Existing Client
CALL Call
WEB Website
EMAIL E-Mail
CONFERENCE Conference
TRADE_SHOW Show/Exhibition
EMPLOYEE Employee
COMPANY Campaign
HR HR Department
MAIL E-Mail Message
OTHER Other
Table 5: CURRENCY_ID – Currencies
Value Description
USD US Dollar
EUR Euro
Table 6: PRODUCT_ID – Products
Value Description
PRODUCT_1 Bitrix Site Manager
PRODUCT_2 Bitrix Intranet
OTHER Other
Aside from the main fields, a lead may have additional custom fields created by the intranet administrator. They can also be passed to the page.

I’m including a file that contains an example script that can be used on your site to create forms and transfer data to the CRM.
Before using this file, you will need to open it and enter your Bitrix24 domain and an account of a user with the right to add a lead.

! We recommend using a separate user with access only to add leads and without access to anything else.
Free. Unlimited. Online
Bitrix24 is a place where everyone can communicate, collaborate on tasks and projects, manage clients and do much more.