Picture of Julian 5069
Registered 4 years 243 days
Julian 5069 Monday, 18 January 2021, 08:15 AM
Search-API Tutorial

Hello,

I'm new to writing software on the PBX and wanted to start with some easy JS apps by following the search API tutorial (innovaphone SDK - Tutorial: Search API).

Unfortunately I'm not able to get the API requests working, the console output shows that the requests should be sent via the websocket connection but the network logging isn't showing any traffic after the app connection has been established.

In the console log I get these messages:

Forward to client:{"mt":"ApiRequest","api":"com.innovaphone.search","provider":"*","src":"9","msg":{"mt":"Search","type":"contact","search":"test"}}
Additional in the app log I get these messages when requesting:
01-18 07:07:42.327 hbsearchapitutorial@pbx-domain.de WebserverPlugin(00c6b3d0,00c6b150)::WebserverPluginWebsocketListenResult(): path = /13A107, registeredPathForRequest = , host = 192.168.17.253
01-18 07:07:42.327 hbsearchapitutorial@pbx-domain.de AppWebsocket(00c78590)::AppWebsocket
01-18 07:07:42.327 hbsearchapitutorial@pbx-domain.de WebserverPlugin(00c6b3d0,00c6b150)::WebsocketAccept(): user = 0x00c78590
01-18 07:07:42.327 hbsearchapitutorial@pbx-domain.de WebserverPlugin(connection id: 3967102)::WebsocketAccept() request accepted
01-18 07:07:42.333 hbsearchapitutorial@pbx-domain.de AppWebsocket(00c78590)::AppWebsocketRecv
01-18 07:07:42.333 hbsearchapitutorial@pbx-domain.de AppWebsocket(00c78590)::WebsocketSendResult() connected=0 sendCount=0
01-18 07:07:42.333 hbsearchapitutorial@pbx-domain.de AppWebsocket(00c78590)::AppWebsocketRecv 

But the attached message handler on client side never get's any messages. I have also tried other client APIs e.g. the devices API with the same results.

I’m working with VS Code 2019 CE and SDK 13r1 13A107

Best regards,

Julian

Picture of Daniel Deterding (innovaphone)
Moderator Registered 15 years 121 days
Daniel Deterding (innovaphone) Wednesday, 20 January 2021, 07:05 AM
Re: Search-API Tutorial
Hi Julian,

a search API request won't be catched by your own App, as long as you do not provide a search provider yourself in your App.

The request is forwarded by the myApps client itself to registrated search providers. In a standard installation this is the contacts app (which is empty by default) and the users app, which should provide the available PBX users.

In addition, the PBX user who is using the App which searches must have rights to these Apps, e.g. to contacts-searchapi and usersapis (which are specific PBX App objects).

So if you have a standard installation after an install, you should be able to open your phone app and search for an existing PBX user and find it. This is just done by the com.innovaphone.search API. If you do the same inside your App, which must be opened inside the myApps client, you should get the same results.

Greetings,
Daniel
Picture of Julian 5069
Registered 4 years 243 days
Julian 5069 Wednesday, 20 January 2021, 01:54 PM
Re: Search-API Tutorial
Hi Daniel,

After testing the app within the myApps platform and configuring the permission, it seems to work correctly.
So if I understand it correctly, the client APIs are only available when the apps are used in the myApps platform. And that was the main problem, I mostly tested the apps directly through the AP manager.

Thanks for the help and greetings,

Julian

← You can define your color theme preference here