Pbx integration

Have been looking at integrating a pbx we work with and would like to get some input.

We have looked at the REST api for ERPNext and are having trouble with what we need.

Here is an example of what we need to call from the pbx to build the app:
https://server.com/contacts/query?callerid=[CALLERID].
We have tried to map to something like this but know this is not correct and of course does not work
https://server.com/desk#Form/User/Administrator/phone

Based on this here:
https://frappe.io/docs/current/models/contacts/contact