Toggle menu

removeReferences

Removes references from a file, as identified by its fileID. 

Explicit references may be removed by supplying them as refDetails, or all references to a file may be removed by supplying just the fileID and removeAllReferences.

The refDetails parameter must be an array of at least one object, with each object containing the keys refType and refIdentifier.

Note that removing references, even removing all references, does not delete the file. You either need to call deleteFiles to delete a file (which will only be deleted once all references have been removed), or set removeFileIfUnreferenced: true

Request Parameters

NameTypeComments
fileIDUUID, requiredUUID file identifier of the file to remove references from
refDetailsList<Reference>, optionalA list of reference objects
removeAllReferencesBoolean, optionalDefault, false. Either removeAllReferences or refDetails must be supplied
removeFileIfUnreferencedBoolean, optionalDefault, false. Set true to also delete the file if the reference being removed is the last one (ie if removing the supplied reference will leave the file unreferenced)

Example Request

This request removes a single reference from the file.

{
    "id": "testreq1",
    "jsonrpc": "2.0",
    "method": "removeReferences",
    "params": {
        "fileID": "655f695d-9f48-4626-8c44-0a87ce9e77e8",
        "refDetails": [{
            "refType": "OBJECT",
            "refIdentifier": "1"
        }]
    }
}

Example Response

The response indicates there are now no references.

{
    "fileDetails": {
        "id": "f618b936-572f-44f1-a300-9944b5b3e2c6",
        "references": [],
        "createdBy": null,
        "created": "2016-02-22T17:01Z",
        "hash": "ba44f7f8f88543fbf91f9b9eb0217cfe",
        "lastUpdatedBy": null,
        "lastUpdated": "2016-02-22T17:01Z",
        "filename": "pusheen.png",
        "type": "image/png",
        "size": 37029
    }
}

Last modified on 27 June 2023

Share this page

Facebook icon Twitter icon email icon

Print

print icon