Bitrix24 Community

Support » Forum » Nathaniel Soria
Select date in calendarSelect date in calendar

Pages: 1
Custom Lead Distribution, lead distribution from a call center software using php and mysql to execute a live transfer of voice and data
We can now assign leads to a different user using an external business process (for example, if the agent didn't pick up the phone, the call center rep can click a button to find another eligible agent in Bitrix24 and re-assign the lead to them before initiating a call, representing themselves as the customers telephone number, to connect with the new assigned agent.) This is now functional using the following in PHP
[CODE] <fo rm action="?test=crm.lead.update.responsible" method="post">
                   <label for="userID">User</label>
                   <select name="userID" required>
               <option value="1">Admin</option>
               <option value="2">Ignacio</option>
             </select>
             <input type="text" placeholder="enter lead ID" name="leadID" required>
             <input type="submit" value="submit">
            </form>
           
           <a href="?refresh=1">Refresh Authorization</a><br />
           <a href="?clear=1">Remove Authorization</a><br />
           
           <?
            $test = isset($_REQUEST["test"]) ? $_REQUEST["test"] : "";
            switch($test)
            {            
                       case 'crm.lead.update.responsible': // test: update lead
           
            $data = call($_SESSION["query_data"]["domain"], "crm.lead.update", array(
            "auth" => $_SESSION["query_data"]["access_token"],
            "ID" => $_POST['leadID'],
            "FIELDS" => array(
             "ASSIGNED_BY_ID" => $_POST['userID']
            )
            ));
           
            break;[/CODE]
Custom Lead Distribution, lead distribution from a call center software using php and mysql to execute a live transfer of voice and data
I finally have authorization working and can update a user using the provided examples from my third party server.. the only thing I'm still stuck on is properly organizing the post url to update a lead's data. Can you please see what I'm doing wrong here? I'm trying to update the lead #172 with a responsible user with ID = 4.
[CODE] case 'crm.lead.update.responsible': // test: update lead
           
            $data = call($_SESSION["query_data"]["domain"], "crm.lead.update", array(
            "auth" => $_SESSION["query_data"]["access_token"],
            "ID" => 172,
            "ASSIGNED_BY_ID" => "4"
            ));
           
            break;[/CODE]
Custom Lead Distribution, lead distribution from a call center software using php and mysql to execute a live transfer of voice and data
That is extremely helpful actually. I know exactly what you're talking about but didn't know how to input the scope when posting correctly so omitted it and thought I was going to be able to get it to work.  :D What is the proper way to put this in? The documentation doesn't explicitly state the format for the application_permissions. So, scope=whatHere?
[CODE]https://intranet_name.bitrix24.com/oauth/token/?grant_type=authorization_code&client_id=app_ID&client_secret=app_secret_code&code=first_authentication_code&scope=application_permissions&redirect_uri=application_URL[/CODE]
That's fine with the different API's as this is a short-term solution so we can begin operations on the 22nd. We were using a different solution that had a very robust lead distribution through an inbound number before and are having to create our own for Bitrix24 (which we like better, minus the lead distribution challenges). The other software is Velocify (formerly Leads360).
Custom Lead Distribution, lead distribution from a call center software using php and mysql to execute a live transfer of voice and data
We will be looking at purchasing the self-hosted version for multiple divisions in the next 6-8 months but are just trying to get the basic project up and running for now.

When I'm posting to update a lead from my external application I'm getting the following error. Do you have more detailed information on it?

<response><error>insufficient_scope</error><error_descriptio­n>The request requires higher privileges than provided by the access token.</error_description></response>

[URL=https://soria.bitrix24.com/rest/crm.lead.update.xml?id=172&RESPONSIBLE=1&auth=]https://soria.bitrix24.com/rest/crm.lead.update.xml?id=172&RESPONSIBLE=1&auth=(i have secret key in here.)[/URL]

I'm trying to do something like that.. just simply change the responsible party on a lead from my external application using POST.

Can you give me a working example of how this link needs to go out or why I don't have the right priveleges. I've followed the steps in the API documentation.
Custom Lead Distribution, lead distribution from a call center software using php and mysql to execute a live transfer of voice and data
It suits us but I need to hand off a call from my predictive dialer software to a user within Bitrix. I just found that Bitrix returns the lead id after we post it to the system so I have been able to fix my problem in the original post. Basically we need a better way to distribute leads than what Bitrix is providing, due to the characteristics of our users (specific licensing and others), so I'm building it externally. Our system will decide, based on a database we'll keep on our bitrix users containing state licensing, active/inactive, daily quotas, etc, which 'Responsible Person' to assign it to in bitrix before executing a call to the Bitrix phone number to connect with the 'Responsible Person' for a warm transfer of the voice (after the data).

I'm a novice/intermediate programmer as my primary role is a branch manager of a mortgage company, by the way, so my knowledge is limited on this technology stuff. I couldn't figure out a way to accomplish this with Bitrix internally.

We use the cloud version but are looking into buying the self-hosted version in the future to further customize and perhaps bring the predictive dialing capability into the software to migrate our call center users over as well.
Custom Lead Distribution, lead distribution from a call center software using php and mysql to execute a live transfer of voice and data
Hi,

I'm building a script to transfer a call from my dialer software to the CRM and to assign it to a user based on a variety of parameters (whether they are licensed in a particular state, are active, haven't hit their quota, are logged in to the custom Bitrix24 personal app, etc) and once the lead has been assigned the call center will call the Bitrix24 telephone number to be connected with the CRM user that the lead was assigned to. We can represent the call coming out of the dialer as the customer's phone number so recognition of the correct customer will be identified by Bitrix24.

The problem:
If a CRM user does not pick up the telephone call I need to re-assign it to a different eligible CRM user (meets certain parameters as defined by our PHP scripts and MySQL DB). In order to edit the existing lead I need to first identify the lead ID from Bitrix24 so that I can get that I can update the lead with said ID to have a different responsible party. Do you have any sample code that I can load on my form that is inputting the data to ask the Bitrix24 API what the lead ID is for a certain lead with a specified telephone number attached to it (the one we POSTed earlier)? What's the sample code to simply update that lead, using the lead ID as the unique identifier, to have a different responsible party?

Thank you for your assistance.

Regards,
Nate
Pages: 1
2,000,000+
organizations
are already using Bitrix24