Delete Folder in EDX Drive ========================== .. admonition:: API Endpoint: delete_folder Delete an existing folder within a private collaborative workspace's EDX Drive. .. important:: An API Key is required for ALL private workspace activities Parameter Definitions --------------------- .. list-table:: :header-rows: 1 * - Parameter name - Description - Required Field * - ``workspace_id`` - The name or ID of workspace that you wish to delete folder in - **Required** * - ``folder_id`` - The ID of the folder that you wish to delete - **Required** Example 1: Delete Folder on EDX Drive ------------------------------------- .. attention:: * Add the ``"User-Agent":`` parameter within the ``headers`` of the API request * Set ``"User-Agent":`` to the value ``"EDX-USER"`` .. tabs:: lang .. code-tab:: python import requests headers = { "EDX-API-Key": 'YOUR_API_KEY_HERE', "User-Agent": "EDX-USER" } workspace_id = 'YOUR-WORKSPACE-ID-HERE' data = { "folder_id": 'YOUR-FOLDER-ID-HERE' } url = f'https://edx.netl.doe.gov/workspace/{workspace_id}/folder/delete' r = requests.post( url, # URL to API endpoint headers=headers, # Headers dictionary data=data, # Dictionary of data params ) print (r.json()) print("End results") .. code-tab:: output { 'help': 'https://edx.netl.doe.gov/api/3/action/help_show?name=delete_folder', 'success': True, 'result': { 'folder_id': 'FOLDER-ID-HERE', 'workspace_id': 'WORKSPACE-ID-HERE', 'workspace_name': 'demo-workspace-test' } }