Go back

How to delete past meetings automatically

July 13, 2021
Dimitrii Zuikov

Dimitrii Zuikov

TrueConf Server does not provide an option for automatic deleting of the conferences that have already finished. However, you can do it occasionally by launching a program which uses TrueConf Server API.

To see the full list of TrueConf Server API features, please read our documentation.

Problem description

If you organize and schedule a lot of meetings, you may need to clear past conferences (e.g. those that have finished for more than a month).

However, you may not simply delete all the meetings that are not launched (i.e. “stopped”), because all currently inactive conferences (even those that have not been started yet) are assigned with a “stopped” status. Moreover, you have to exclude the conferences with an automatic start schedule, e.g., weekly recurring meetings, from the removal list.

Thus, you need to delete scheduled one-time events which have finished for a certain number of days.

To see a code example of this case, please visit our GitHub.

Step 1. Determining a specific date and time for removing the meetings

You need to choose a date: all meetings that have been created before the specified date will be deleted. In order to determine this date you should subtract the required number of days from the current date. The result should be converted in Unix Timestamp format. For instance, if you need to remove the сonferences that have finished by June 1, 2021, 9 p.m. UTC you will get 1622494800.

Step 2. Getting conference list

You can obtain a list of conferences by using the Get Conference List method and specifying the additional parameter state=stopped.

As a result you will get JSON with Conference object list.

Step 3. Searching for the conferences to be deleted

For each conference from the conference object list you should do the following:

  1. Check a conference schedule type by using Schedule object (it has to be a one-time meeting "type":1).
  2. If the conference ending time which equals its starting time start_time plus its duration duration is less than you get in step 1, save its ID and do the next step.

Step 4. Deleting a conference

Delete a conference by using DELETE-request Delete Conference, where you should specify its ID.

If you create conferences by using the Create Conference API request and don’t want to delete all the finished conferences, you can reduce the number of meetings in the list that you got in step 2. To do so, assign a special tag (e.g., "tags":["delete"] parameter) when creating events that will need to be deleted. In this case, when doing step 2 you can use tag=delete parameter to specify the list of past meetings.

Still have questions? Please contact our support team directly via online chat.

Sign up for newsletter