[#483] How to use searchString in getUnitList() method?

Migrated from Redmine #483 | Author: Vincent RIFA
Status: New | Priority: Normal | Created: 2020-03-06


Hello,
I cannot find a way to use the param searchString of the getUnitList() method.

What ever param I use, it brings me back a full list of my Service Providers :
@
var performers = client.getUnitList(true, true, -1, “Peter Benton”);
console.log("performers : " + JSON.stringify(performers));@

performers : [{"id":"3","name":"Peter Benton","description":"","phone":"","email":"peter.benton@yopmail.com","station_id":"1","qty":"1","is_active":"1","position":"3","is_visible":"1","file_id":null,"seo_url":null,"picture":null,"picture_sub_path":null,"picture_path":null,"event_map":{"2":null},"services":[2],"user":false,"classes_plugin_info":{"event_binded_in_class":null,"events_binded_in_classes":[]}},{"id":"4","name":"Dr Mario","description":"","phone":"","email":"dr.mario@yopmail.com","station_id":"1","qty":"1","is_active":"1","position":"8","is_visible":"1","file_id":null,"seo_url":null,"picture":null,"picture_sub_path":null,"picture_path":null,"event_map":{"2":null},"services":[2],"user":false,"classes_plugin_info":{"event_binded_in_class":null,"events_binded_in_classes":[]}},{"id":"5","name":"Pascal Joly","description":"","phone":"","email":"pascal.joly@yopmail.com","station_id":"1","qty":"1","is_active":"1","position":"10","is_visible":"1","file_id":null,"seo_url":null,"picture":null,"picture_sub_path":null,"picture_path":null,"event_map":{"5":null},"services":[5],"user":false,"classes_plugin_info":{"event_binded_in_class":null,"events_binded_in_classes":[]}}]

Is the params still used?
How should I use it?

Thanks in advance,
Vincent Rifà

Redmine Admin wrote:

Hi,

it should work fine. Please provide raw http request

Vincent RIFA wrote:

Thanks for your repply.
Here it is:

Request URL: https://user-api.simplybook.me/
Request Method: POST
Status Code: 200 
Remote Address: 158.69.26.11:443
Referrer Policy: no-referrer-when-downgrade
access-control-allow-headers: content-type, x-company-login, x-application-token, x-user-token, x-token, x-requested-with
access-control-allow-methods: POST, GET, OPTIONS
access-control-allow-origin: *
content-encoding: gzip
content-type: application/json; charset=UTF-8
date: Fri, 06 Mar 2020 12:36:36 GMT
server: nginx
status: 200
vary: Accept-Encoding
x-xss-protection: 1; mode=block
:authority: user-api.simplybook.me
:method: POST
:path: /
:scheme: https
accept: application/json, text/javascript, */*; q=0.01
accept-encoding: gzip, deflate, br
accept-language: fr-FR,fr;q=0.9,en-US;q=0.8,en;q=0.7
cache-control: no-cache
content-length: 86
content-type: application/json
origin: https://www.apizee.com
pragma: no-cache
referer: https://www.apizee.com/inte/Vincent/mestests/simplybookme/datepicker.html
sec-fetch-dest: empty
sec-fetch-mode: cors
sec-fetch-site: cross-site
user-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) snap Chromium/80.0.3987.132 Chrome/80.0.3987.132 Safari/537.36
x-company-login: apizee
x-token: ad9a1f7b0f136de2b2059196d2781279a1f1ed1297a1f9bc865e39424899a969
{jsonrpc: "2.0", method: "getUnitList", params: [true, true, -1, "Peter Benton"], id: 2}
jsonrpc: "2.0"
method: "getUnitList"
params: [true, true, -1, "Peter Benton"]
id: 2

Redmine Admin wrote:

thank you, it was bug, fixed now.

Vincent RIFA wrote:

Yes, it works now :slight_smile:
Thanks for your quick response!

Vincent RIFA wrote:

Hello,
I have the same problem with getEventList() : Returned list is not filtered by searchString…
Here is my request:

{"jsonrpc":"2.0","method":"getEventList","params":[true,true,-1,"Apizee CHU"],"id":1}

Redmine Admin wrote:

please try again, should be fine now

Vincent RIFA wrote:

Sorry, but I keep having the full list :confused:

Redmine Admin wrote:

You are right. Updated servers with fix, please try again and sorry for delay.

Vincent RIFA wrote:

It works fine now :wink:
Thanks!