Solved Deleting phonebook entries via xapi

Status
Not open for further replies.

InternetLadenKarlsruhe

Customer
Joined
Apr 24, 2020
Messages
3
Reaction score
2
Hi,

we're using 3CX Enterprise edition with auto updates enabled.

Our requirement is to delete all phonebook contacts via xapi.

Until recently, the following worked just fine:

POST /xapi/v1/Contacts/Pbx.AllContactsBulkDelete

However, since a recent auto update (starting 1.5 weeks ago or so),
this endpoint raises the following error message:

HTTP/1.1 405 Method Not Allowed
Allow: GET

A GET request on the same URL then results in an error 404.

What is the current, correct way to delete phonebook entries via xapi?
Doesn't have to be by bulk (although preferred), deleting 1 by 1 would
be ok as well.

We're importing phonebook entries from an external system (via
/xapi/v1/Contacts/Pbx.ImportContacts, which is working fine) and we
need to delete all phonebook entries before importing to avoid
duplicates (and even if we actually were matching the entries, we
would still need to delete contacts that no longer exist in the
source database).

Thank you for your help.
 
Hello InternetLadenKarlsruhe,

Please note that the release 8 has some changes to the phonebook contacts, as it now also does have Department phonebooks.

[ for Company Contacts ]
type: POST
https:// fqdn : port /xapi/v1/Contacts/Pbx.DeleteContactsByType
{} <- empty for all, or send contact ID

[ for Department Contacts]
type: POST
https:// fqdn : port /xapi/v1/Contacts/Pbx.DeleteDepartmentContactsByType
{} <- empty for all, or send contact ID

[ or try this for single contact ]
type: DELETE
https:// fqdn : port /xapi/v1/Contacts(ID)
(*no body data)

Hope this does help.

Paulo
 
Thank you so much! :-)

That did the trick.
 
Status
Not open for further replies.