Solved

Delete a specific call log item by id

  • 29 April 2022
  • 2 replies
  • 422 views

Is there any way to delete a selected call log by callRecordId? Ref API : https://developers.ringcentral.com/api-reference/Call-Log/deleteUserCallLog Getting detail has a way to ask for a specific log by callRecordId but delete does not have that parameter.
icon

Best answer by Phong1426275020 29 April 2022, 19:25

View original

2 replies

Yes you can. Make a HTTP DELETE to the endpoint '/account/~/extension/~/call-log/' + recordId Here is a sample code using the RingCentral Node JS SDK async function read_own_calllog(){ try { var resp = await platform.get('/restapi/v1.0/account/~/extension/~/call-log', { dateFrom: '2022-04-01T00:00:00.000Z' }) var jsonObj = await resp.json() for (var record of jsonObj.records){ if (record.id == "XXXXXXXXXX"){ // a record id you want to delete deleteRecordById(record.id) break } } }catch(e) { console.error(e.message); }; } async function deleteRecordById(recordDd) { try { var resp = await platform.delete('/restapi/v1.0/account/~/extension/~/call-log/' + id) console.log(resp) }catch(e) { console.error(e.message); }; }
Aaha, never thought about it as it was not documented but thanks for pointing it out.

Reply