SmartDocumentor
  • Overview
    • SmartDocumentor
  • GETTING STARTED
    • About SmartDocumentor
    • How SmartDocumentor Works
    • Main concepts
      • Workspaces
      • Organization
    • Quickstart 101
    • Licenses
      • How to Buy?
      • Support
    • Privacy
    • Security
  • Technical
    • Initial Setup
    • Mappings
    • API Reference
      • [POST] Client Credentials Access Token
      • [GET] Task Status
      • [GET] Task Status List
      • [GET] Task Status List Paginated
      • [GET] Get Workspaces
      • [PATCH] Reprocess Task
      • [POST] Create Task
      • [POST] Create Batch
      • [GET] Get Batch
      • [GET] Get Batch Paginated
      • Transcripts
        • Speakers
          • Workspaces
            • [GET] Workspace Speakers
            • [PUT] Workspace Speakers
          • Tasks
            • [GET] Task Speakers
            • [POST] Task Speaker
            • [PUT] Task Speaker
            • [DELETE] Task Speaker
      • Invite Users
        • [GET] List Available Roles
        • Tenants
          • [GET] List All Tenant Users
          • [POST] Invite Users
        • Workspaces
          • [GET] List All Workspace Users
          • [POST] Invite Users
    • Folder Worker
    • Export
      • Webhooks
        • Webhook (Text Documents)
        • Webhook (Transcripts)
        • Webhook Url To File (Transcripts)
        • Webhook Url to File (Anonymization)
    • Changelog
  • FAQs
    • FAQs
Powered by GitBook
On this page
  • Finding your Workspace Id and Tenant Id
  • Installation and Setup
  • Basic Usage
  • Available Options
  • Practical Examples
  • Common Errors and Solutions
  1. Technical

Folder Worker

Previous[POST] Invite UsersNextExport

Last updated 2 months ago

This worker automates the file import process. It allows parameterization such as filters, monitoring time, specific folders, and more, in addition to integrating with external services via API.

We use the for authentication with external client applications.

To find out how you can obtain your own Client ID / Client Secret pair, check the section.

Finding your Workspace Id and Tenant Id

Head to the screen and click the Import button, then the Folders tab.

Installation and Setup

Before using the worker, ensure that the executable is available on your system.

  • Download the appropriate executable for your operating system.

  • To check available options, open a terminal and run:

<executable> --help

Basic Usage

The basic command structure is:

<executable> [options]

Minimal example:

<executable> --client-id "your-client-id" --client-secret "your-client-secret" --tenant-id 201 --workspace-id 778

Available Options

Below are all available options:

Option
Description
Required/Optional

--client-id

The unique identifier for authentication with external services.

Required

--client-secret

The secret key associated with the client ID for secure authentication.

Required

--tenant-id

The unique identifier of the tenant.

Required

--workspace-id

The unique identifier of the workspace.

Required

--api-url

Optional

--tus-url

Optional

--filters

Filters applied when monitoring files (e.g., `*.pdf`).

Optional

--action

Action to perform on files: Move or Remove. Default is Remove.

Optional

--folder

The directory path where files should be monitored for changes or additions. Defaults to the current directory where the command is executed or the value provided (e.g., /path/to/watch).

Optional

--destination-folder

Directory where files will be moved if --action is Move. Required if Move.

Required if --action is Move

--include-subdirectories

Whether to include subdirectories. Default is false.

Optional

--delay

Delay in milliseconds between file checks (minimum: 30,000 ms, maximum: 300,000 ms). Default is 30,000 ms.

Optional

--help

Displays this help message.

Practical Examples

Run with basic credentials

<executable> --client-id "your-client-id" --client-secret "your-client-secret" --tenant-id 201 --workspace-id 778

Monitor PDF and JPG files

<executable> --client-id "your-client-id" --client-secret "your-client-secret" --tenant-id 201 --workspace-id 778 --filters "*.pdf|*.jpg"

Monitor a specific folder for PDF and JPG files every 30 seconds and move them to another folder

<executable> --client-id "your-client-id" --client-secret "your-client-secret" --tenant-id 201 --workspace-id 778 --folder "/path/to/watch" --destination-folder "/path/to/destination" --filters "*.pdf|*.jpg" --delay 30000 --action Move

Common Errors and Solutions

  1. Error: "Filters must be provided" Cause: The --filters option is missing. Solution: Ensure that a valid filter is provided via command-line argument or configuration.

  2. Error: "Invalid delay value" Cause: The --delay value is outside the allowed range. Solution: The delay must be between 30,000 ms (30 seconds) and 300,000 ms (5 minutes).

  3. Error: "Invalid action type" Cause: The --action value is not Move or Remove. Solution: Ensure that the action is correctly set as Move or Remove.

  4. Error: "Destination folder required when action is Move" Cause: The --destination-folder is missing when --action Move is used. Solution: Provide a valid destination folder via command-line argument or configuration.

  5. Error: "API Base URL must be provided" Cause: The --api-url is missing. Solution: Ensure the API base URL is included in the command-line arguments.

  6. Error: "TUS Base URL must be provided" Cause: The --tus-url is missing. Solution: Provide a valid TUS upload service URL.

  7. Error: "Client ID is required" Cause: The --client-id is missing. Solution: Ensure the client ID is correctly specified in the command.

  8. Error: "Client Secret is required" Cause: The --client-secret is missing. Solution: Provide a valid client secret.

  9. Error: "Tenant ID must be greater than zero" Cause: The --tenant-id is missing or set to zero. Solution: Ensure the tenant ID is a positive integer.

  10. Error: "Workspace ID must be greater than zero" Cause: The --workspace-id is missing or set to zero. Solution: Provide a valid workspace ID greater than zero.

The URL endpoint for integration with the processing worker, facilitating external service communication. Default value: . Contact support for changes.

The URL endpoint for integration with the processing worker, facilitating external service communication. Default value: . Contact support for changes.

https://cloud.smartdocumentor.net
https://cloud.smartdocumentor.net
client credentials OAuth2.0 flow
Tasks Inbox
Create Secrets