Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

delete

URL/api/v1/api.php?target=resource&action=delete
DescriptionDelete a resource.
ReturnsExamples:
SUCCESSFUL: {"success":1,"message":"Resource deleted."}
ERROR: {"success":0,"message":"No resource found with ID: 57"}
Required Parameters
NameTypeNotes/Example
idINTEGERID of the resource
Optional Parameters
NameTypeNotes/Example
recursiveBOOLWhen 1, deletes parent and child entries for the resource

A recursive delete will delete all resources, which are permitted to be deleted, from the bottom up.

Imagine the following hierarchy:

Code Block
             A
    B1                B2
C11    C12        C21    C22

If a recursive delete is performed on A, but C21 is not deletable, the following

resources would still be deleted: (B1, C11, C12, C22).

B2 would not be deleted because it depends on C21 and A would not be deleted because it depends on B2.

 

Example URL/api/v1/api.php?target=resource&action=delete&id=57