Bitrix24 Community

Support » Forum » Steve Kinyon
Select date in calendarSelect date in calendar

Pages: 1
REST API example on how to do a wildcard search, Need a REST API example on how to do a wildcard search for finding contacts in the CRM
Thank you but I have been referring to the REST API.  Here is the page:

 [URL=https://training.bitrix24.com/rest_help/crm/contacts/crm_contact_list.php]https://training.bitrix24.com/rest_help/crm/contacts/crm_contact_list.php[/URL]

This is the only example and it is using the Javascript Library. The Javascript Library doesn't appear to support usage in external systems.

This is the call I'm modeled the REST API call from:

       BX24.callMethod(
           "crm.contact.list",
           {
               filter: { "PHONE": "555888" },
               select: [ "ID", "NAME", "LAST_NAME" ]
           },
           function(result)
           {
               if(result.error())
                   console.error(result.error());
               else
               {
                   console.dir(result.data());  
                   if(result.more())
                       result.next();      
               }
           }
       );

You can see in my first post that I've done the translation to make the API work despite the lack of documentation, but I need to know more about the 'filter:' argument.

There appears to be no documentation around 'filter:'.  I noticed some list calls have date examples using <>= but nothing on searching text.

A working example like I've asked for above would help a lot.  A full list of 'filter:' arguments with the REST API & Javascript examples would be best.

Regards,

Steve Kinyon
Edited: Steve Kinyon - 01/11/2016 19:52:18
Using the Bitrix Javascript Library in an external app.
The documentation indicates the library can be used by externally when it says, "External applications may use it if so required."
[URL=https://training.bitrix24.com/rest_help/js_library/library.php]https://training.bitrix24.com/rest_help/js_library/library.php[/URL]

However, there doesn't appear to be a way to set the domain and oauth id (or any of the other required parameters).  Can you give me an example on how to use the library in an external application?
Edited: Steve Kinyon - 01/09/2016 04:58:49
REST API example on how to do a wildcard search, Need a REST API example on how to do a wildcard search for finding contacts in the CRM
From an external system I want to use the crm.contact.list to search for contacts by the first and last name.  Where can I get an example on how to do this, both url encoded and pre-url encoded?

Here is a url encoded filter call that works to find the Last Name of 'Smith':
[CODE]https://myaccount.bitrix24.com/rest/crm.contact.list.json?=&FILTER%5BLAST_NAME%5D=Smith&ORDER%5BLAST_NAME%5D=ASC&auth=some_auth_code
[/CODE]
The filter information un-encoded appears to be this:
&FILTER[LAST_NAME]=Smith
&ORDER[LAST_NAME]=ASC

I need to do something like find all contacts that match by wildcard, as in find first and last names that have 'sm' in them.  I've tried it with * as the wildcard but it doesn't work:

&FILTER[LAST_NAME]=*sm*
&FILTER[FIRST_NAME]=*sm*
&ORDER[LAST_NAME]=ASC
Edited: Steve Kinyon - 01/09/2016 03:57:11
Pages: 1
3,500,000+
organizations
are already using Bitrix24