Skip to content

Attachments Delete Bulk

Stevan Freeborn edited this page Apr 15, 2024 · 4 revisions

This command is intended to help Onspring customers delete multiple attachments at once from one or more attachment/image fields from one or more records.

General Usage

When executing the command you will need to provide it with a Source Api Key and an App Id which the app will use to delete the attachments contained within the app that corresponds to the given App Id.

These pieces of information need to be provided as command-line arguments.

onspringcli.exe attachments delete bulk -sk 000000ffffff000000ffffff/00000000-ffff-0000-ffff-000000000000 -a 100

Notes:

  • Source Api Key can be obtained as outlined in this repository's README.md API Key section.
  • App Id can be obtained...
    • by using the Onspring API's /Apps endpoint
    • by looking at the url of the app in your browser. i.e. https://instance.onspring.com/Admin/App/134

Options

This command currently has a number of options that can be passed as command-line arguments to alter the behavior of the command. These can be viewed by passing the -h or --help option to the command.

  • App Id: --app-id or -a
    • Allows you to specify an App Id to delete attachments from.
    • Example usage: onspringcli.exe attachments delete bulk -a 100
  • Fields Filter: --fields-filter or -ff
    • Allows you to specify what fields attachments will be deleted from by providing a comma separated list of field ids.
    • Example usage: onspringcli.exe attachments delete bulk -ff 1,2,3
  • Records Filter: --records-filter or -rf
    • Allows you to specify what records attachments will be deleted from by providing a comma separated list of record ids.
    • Example usage: onspringcli.exe attachments delete bulk -rf 1,2,3
  • Report Filter: --report-filter or -rpf
    • Allows you to specify an id for a report whose records' attachments will be deleted.
    • Example usage: onspringcli.exe attachments delete bulk -rpf 1

Note:

  • The filter options are additive to one another.
  • These are in addition to the Global Options detailed in this repository's README.md.

Error Report

If the app encounters any errors while executing the command and deleting the attachments it will write a file-request-errors.csv to a directory named output that details the attachments that could not be deleted. The file will contain the following information about each attachment that could not be deleted:

  • Record Id: The id of the record that the attachment is attached to that could not be deleted
  • Field Id: The id of the field that the attachment is held in that could not be deleted
  • Field Name: The name of the field that the attachment is held in that could not be deleted
  • File Id: The id of the attachment that could not be deleted
Clone this wiki locally