Skip to main content
Answer

Delete a specific call log item by id

  • April 29, 2022
  • 2 replies
  • 537 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.

Best answer by PhongVu

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); }; }

2 replies

PhongVu
Community Manager
Forum|alt.badge.img
  • Community Manager
  • Answer
  • April 29, 2022
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); }; }

  • Author
  • New Participant
  • April 29, 2022
Aaha, never thought about it as it was not documented but thanks for pointing it out.