question

Ashvin Patel avatar image
Ashvin Patel asked Ashvin Patel answered

Delete a specific call log item by id

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.

call logs
1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Phong Vu avatar image
Phong Vu answered

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

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Ashvin Patel avatar image
Ashvin Patel answered

Aaha, never thought about it as it was not documented but thanks for pointing it out.

1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Developer sandbox tools

Using the RingCentral Phone for Desktop, you can dial or receive test calls, send and receive test SMS or Fax messages in your sandbox environment.

Download RingCentral Phone for Desktop:

Tip: switch to the "sandbox mode" before logging in the app:

  • On MacOS: press "fn + command + f2" keys
  • On Windows: press "Ctrl + F2" keys