Actions6
Overview
This node integrates with the Swan.io API to perform various operations related to account management, transactions, consents, and credit transfers. Specifically, the "Mutation - GrantConsentWithServerSignature" operation allows users to grant consent by signing a challenge with a server-side private key. This is useful in scenarios where secure authorization of consents is required, such as financial applications needing explicit user consent for actions.
Practical examples include:
- Granting user consent securely using a server signature to comply with regulatory requirements.
- Automating consent workflows in banking or payment platforms.
- Integrating consent granting into larger automation pipelines that manage accounts and transactions.
Properties
| Name | Meaning |
|---|---|
| Authentication | Choose between "User Access Token" or "Project Access Token" to authenticate the request. |
| Consent ID | The unique identifier of the consent to be granted. |
| Consent Challenge | A challenge string that must be signed with the server's private key to authorize consent. |
Output
The output JSON contains the response from the Swan.io API after attempting to grant consent with the server signature. It typically includes confirmation details about the granted consent or error information if the operation failed.
No binary data output is produced by this operation.
Dependencies
- Requires an API authentication token, either a user access token or project access token depending on the operation.
- For the "GrantConsentWithServerSignature" operation, a server consent private key must be configured in the node credentials to sign the consent challenge.
- Uses internal helper functions to sign JWT tokens and make authenticated API requests to Swan.io.
Troubleshooting
Error: "This resource needs a user token to be requested"
Occurs if the selected authentication method is not "User Access Token" when performing the grant consent operation. Fix by selecting the correct authentication type.Error: "This resource needs a Server Consent Private Key configured to be used"
Happens if the server private key credential is missing or empty. Ensure the private key is properly set up in the node credentials.General API errors
May result from invalid consent IDs, expired challenges, or network issues. Verify input values and connectivity.Unsupported operation error
If an unsupported operation is selected, the node throws an error. Confirm the operation name matches supported options.
Links and References
- Swan.io API Documentation (for detailed API usage and consent management)
- JWT (JSON Web Tokens) Specification
- n8n documentation on Creating Custom Nodes