I have 300-400 CiviCRM smart groups I want to delete. I will know the id for the group but need to know what other tables I need to delete that may be related.
Also, is there any way to identify which groups are smart groups?
Here is some code I have tried.
<?php
require_once 'api/class.api.php';
$api = new civicrm_api3();
$result = $api->group->delete ( $id=1544 );
?>
Here is the result:
PHP Fatal error: Class 'CRM_Core_Config' not found in /home/daweb_dev/democratsabroad/drupal/sites/all/modules/civicrm/api/class.api.php on line 92
PHP Stack trace:
PHP 1. {main}() /home/daweb_dev/democratsabroad/drupal/sites/all/modules/civicrm/delgroup.php:0
PHP 2. civicrm_api3->__construct() /home/daweb_dev/democratsabroad/drupal/sites/all/modules/civicrm/delgroup.php:3
This worked using rest.php
wget -a delgroup.log -O delgroup.out 'https://www.example.com/sites/all/modules/civicrm/extern/rest.php?entity=group&action=delete&key=site-key&api_key=api-key&version=3&json=1&id=923'