Migrated from Redmine #156 | Author: Rohit Bhattad
Status: Closed | Priority: Normal | Created: 2018-05-02
Can you help me on how we fetch service providers for a service?
The below json payload doesn’t work
{“jsonrpc”:“2.0”,“method”:“getUnitList”,“params”:[{“unit_group_id” : [ 27 ]}],“id”:1}
Redmine Admin wrote:
it should be {“jsonrpc”:“2.0”,“method”:“getUnitList”,“params”:[ 27 ],“id”:1}
Rohit Bhattad wrote:
Hello,
The json does not work. I am invoking below link.
http://user-api.simplybook.me/
json:
{“jsonrpc”:“2.0”,“method”:“getUnitList”,“params”:[ 27 ],“id”:1}
Dmytro Bondarev wrote:
Hi!
In any case you have to get all service providers. Use getUnitList for this and pass parameters that you need (please follow API reference).
The service object contains unit_map you can use it to filter your service providers.
Rohit Bhattad wrote:
I actually need help on how to set params. All below do not work
{“jsonrpc”:“2.0”,“method”:“getUnitList”,“params”:[ 14,{“services”:17 } ],“id”:1}
{“jsonrpc”:“2.0”,“method”:“getUnitList”,“params”:[ 14 ],“id”:1}
{“jsonrpc”:“2.0”,“method”:“getUnitList”,“params”:[ 14, {" unit_map ":17 } ],“id”:1}
Dmytro Bondarev wrote:
there is no such parameters in this method. Please follow documentation.
Rohit Bhattad wrote:
The documentation is below:
@param Boolean $isVisibleOnly
@param Boolean $asArray
@param integer $handleClasses 1 - classes only, -1 without classes, null - skip classes check
@return Array
{“jsonrpc”:“2.0”,“method”:“getUnitList”,“params”:[27, {“isVisibleOnly”:“1”,“asArray”:“1” } ],“id”:1}
I want all units in service id 1. how can I get this?