Delete SMS via API or SSH

,

Hi all,

Please move this to the correct forum category, I wasn’t sure which category this fits into.

We need a means to remotely delete the stored SMS on the device.

For now the device can only store 20 SMS and they can only be deleted by logging into the Web Admin Panel on the device.

This will impact the ability to realise and utilise any potential use of the SMS Control or API features on the device.

In the case of SMS Control we can only issue 20 commands before the device is maxed out. There is no obvious way to action an SMS rotation either; so the oldest would be deleted.

We need a method that can be automated by API/SSH which enables the deletion of the messages to make more space.

Anyone got any brainy ideas? I’ve just thrown a day at it and made no progress.

We do have the API call to delete the SMS from the router itself.

Refer to 1.png, I am using this API call to list out the SMS inside the router.

  • in this example, I am doing an API call to GET /api/cmd.sms.get
  • it is expecting connId as the parameter
  • in my example, the connId for my cellular WAN1 is 2

Refer to 2.png, I am using this API call to delete the specific SMS inside the router.

  • in this example, I am doing an API call to POST /api/cmd.sms.delete
  • it is expecting 3 parameters as highlighted inside 2.png
  • I am deleting SMS id 15 and 16 in this example
3 Likes

I ended up using SSH with the mmcli tool to delete messages manually. There’s no current API method to do it, so SSH is the only way I found that works.

Ran into the same limit on a device I was testing. What worked for me was setting up a small script to check the SMS count and delete the oldest automatically via the API—kept the device from maxing out. While testing, I also tried sending messages with bulk sms for a side project, and the instant delivery confirmed the rotation script was clearing space fast enough.