Directus icon

Directus

Consume Directus API

Overview

The node provides various utility operations for interacting with the Directus API, including generating hashes. Specifically, the Generate Hash operation takes a string input and returns its hash value by calling the Directus API's hashing endpoint.

This node is useful when you need to securely hash strings within your workflow, such as passwords, tokens, or any sensitive data that requires hashing before storage or comparison.

Example use cases:

  • Hashing user passwords before saving them in a database.
  • Generating hashed tokens for authentication or verification purposes.
  • Creating unique identifiers based on string inputs.

Properties

Name Meaning
String The input string to be hashed.

Output

The output JSON contains the result of the hash generation. It typically includes the hashed string under a key like result or similar, depending on the API response structure.

Example output JSON:

{
  "result": "hashed_string_value"
}

No binary data output is produced by this operation.

Dependencies

  • Requires an active connection to a Directus instance via an API key credential.
  • The node uses the Directus API endpoint utils/hash/generate to perform the hash generation.
  • Proper API credentials must be configured in n8n to authenticate requests.

Troubleshooting

  • Common issues:

    • Invalid or missing API credentials will cause authentication errors.
    • Providing an empty or null string may result in an error or unexpected output.
    • Network connectivity problems can prevent successful API calls.
  • Error messages:

    • Authentication failures: Ensure the API key or token is valid and has sufficient permissions.
    • Invalid input errors: Verify that the "String" property is provided and not empty.
    • API request failures: Check the Directus server status and network connectivity.

Links and References

Discussion