V-Spark Online Help

Using DELETE with cURL and the /config API

Use the /config API to delete information about companies, organizations, folders, applications, and users.

The cURL commands to DELETE V‑Spark configuration data using the V‑Spark API enable you to delete all, or specified, companies, organizations, folders, and applications. These commands do not require JSON data as an input, but simply require that you identify the object or objects that you want to delete. The /config API's DELETE methods provide two options that enable you to refine the scope of what is being deleted:

Table 1. /config/orgs DELETE Options

Name

Type

Values

Description

tree

Boolean

true, false (default)

Optional, only used with DELETE method. Companies that contain users & organizations and organizations that contain folders & applications are not considered to be empty. By default, only empty elements may be deleted from a V‑Spark installation. If set to true, non-empty companies and organizations will be deleted.

To delete a non-empty element with tree, you will also need to set multi to true to enable multiple items to be deleted at once.

multi

Boolean

true, false (default)

This parameter is optional, and is only used with DELETE method. By default, you can only delete a single item at one time in a V‑Spark installation. If set to true, multiple items may be deleted at the same time as the result of a single DELETE request.



For example, a cURL command to delete the single folder Test01 and everything below it is the following:

curl -s -X DELETE example.company.com/config/DocTestCo/DocTestCo/Test01?token=123456789012345678901234567890123

In this example command, you are only deleting a single folder, so you do not need to specify the multi=true parameter. You do not need to specify the tree=true options because there is nothing that is hierarchically under a single folder.

As another example, a cURL command to delete all folders and everything below them is the following:

curl -s -X DELETE example.company.com/config/folders \
    ?token=123456789012345678901234567890123&multi=true

In this example, you do not need to specify the tree=true parameter because nothing is hierarchically located under a folder, but you do need to specify the multi=true parameter because you are deleting all folders that exist on the target host.

When using cURL to DELETE data from a host using the /config API, you must use the following cURL option:

-X

Identifies the request method to use (DELETE) when communicating with the target HTTP server

The cURL command's -s options is optional, causing the cURL command to run in silent mode, in which it does not display progress information or error messages.