Jump to content
MJanssen

advancedSearch Parameter of com.hornbill.servicemanager::getOrganisationsList

Recommended Posts

Hi,

I'm wondering if anyone has any pointers on how the advancedSearch Input Parameter works as part of this operation:

https://api.hornbill.com/apps/com.hornbill.servicemanager/?op=getOrganisationsList

i'm am trying to retrieve organisations based on a phone number. The phone number is part of an object which is then serialized to a JSON String that outputs for example:

{"h_phone_number":"123456789"}

This is then given as a string for the input parameter advancedSearch. This gives me no errors, but also does not find any results. although the phone number is known for an organisation.

Input XML:

<methodCall service="apps/com.hornbill.servicemanager" method="getOrganisationsList"><params><rowstart>0</rowstart><limit>3</limit><advancedSearch>{"h_phone_number":"123456789"}</advancedSearch></params></methodCall>

OutPut XML

<?xml version="1.0" encoding="utf-8"?><methodCallResult status="ok"><params><organisations>[]</organisations><count>0</count></params><flowCodeDebugState><step>xxxxxxx</step><executionId>xxxxxxxx</executionId></flowCodeDebugState></methodCallResult>

Any help would be greatly appreciated!

Share this post


Link to post
Share on other sites

Hi @MJanssen,

This flowcode although is available, is pretty much for internal use mainly because its complexity.

It is also a core flowcode although it will be visible in the service manager app because it will extend it.

The example:

<methodCall service="apps/com.hornbill.core" method="getOrganisationsList">
  <params>
    <filter>%%</filter>
    <rowstart>0</rowstart>
    <limit>30</limit>
    <advancedSearch>{"h_phone_number":{"binding":"h_phone_number","controlType":"text-anchor","value":"077123456789"}}</advancedSearch>
  </params>
</methodCall>

 

Thanks,

Daniel

Share this post


Link to post
Share on other sites

@Daniel Dekel After you example i have succesfully requested an organization by a phone_number! However i do have some concerns for my usecase.

We use Swyx to perform and receive calls. I am trying to integrate a 'Open organization page' button in our swyx software. so users can view the organization page (or get a list of organizations)of the current caller with the click of a button. This method however only provides a results for an exact phone number match.

Currently in Hornbill it is possible to perform a search using a small part of a phone number in this filter field.

image.thumb.png.6befb0ceedcfb074030574a5a000eaf6.png

as you can see in the bottom of the screenshot there a 4 matches.

Is there any way that you know of, to call this functionality and return a list or page including these matches using the Hornbill API?

 

Kind regards, Menno

Share this post


Link to post
Share on other sites

Hi @MJanssen,

The example I've sent to you is doing exactly that.

The 

"controlType":"text-anchor"

will do a search using wildcards at the beginning and at the end of the search criteria (the value). You can use also just "text" instead "text-anchor". This type of search will be a bit longer than an exact match but will work.

Also, make sure you use the rowstart as 0 and the limit to a higher number as in the example. This is used for paging in the UI.

You can also see how this works with the UI if you are familiar with the Chrome Developer Tools. Press F-12 and switch to the Network Tab. You will be able to see all the XMLMC calls, the requests and responses. That way you can practice with the UI and use the same request code to your needs.

Hope it helped.

Daniel.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×