Enhancement request - return full paths to objects
Posted: 04 Mar 2019 06:56
At present, using O2G for doing PBX object manipulations requires intimate knowledge about the internal data structure of the OXe, notably paths.
Let's take hunting groups as an example. You get the model by GET'ing on /model/Station_Group". You list all Huntgroups by GET'ing on /Station_Group.
Nowhere does it tell you that to extract a single hunting group, you GET on /Group/1/Station_Group/{directoryNumber}. IMHO, the path should be returned on the model and ideally also in the list. I knew a few REST APIs where the list returns you the path to the individual objects. In order to retain compatibility, I propose to extend the model with a new property that gives the full path. E.g. when extracting the huntgroup, the PbxObject would have a new string property called ObjectPath which would contains "Group/1/Station_Group". So you can take the existing ObjectId and ObjectPath to generate the full path the object. {ObjectName}/{ObjectId} works for some objects but not for others... my approach would make it possible to use the same path construction for all objects regardless of the object hierarchy.
Let's take hunting groups as an example. You get the model by GET'ing on /model/Station_Group". You list all Huntgroups by GET'ing on /Station_Group.
Nowhere does it tell you that to extract a single hunting group, you GET on /Group/1/Station_Group/{directoryNumber}. IMHO, the path should be returned on the model and ideally also in the list. I knew a few REST APIs where the list returns you the path to the individual objects. In order to retain compatibility, I propose to extend the model with a new property that gives the full path. E.g. when extracting the huntgroup, the PbxObject would have a new string property called ObjectPath which would contains "Group/1/Station_Group". So you can take the existing ObjectId and ObjectPath to generate the full path the object. {ObjectName}/{ObjectId} works for some objects but not for others... my approach would make it possible to use the same path construction for all objects regardless of the object hierarchy.