Mi2u Login Token
MI2U custom Node for Login and get Token for ICS (should put before and beside mi2u node)
Overview
This node performs authentication against the Myinvoice2u (MI2U) service by logging in with a user’s email and password to obtain an authentication token in the form of a cookie. It is designed to be used before other MI2U-related nodes that require this token for subsequent API calls.
Common scenarios include:
- Automating workflows that interact with the MI2U platform, where you need to authenticate first to get a session token.
- Integrating MI2U invoice or accounting data into other systems by first obtaining a valid login token.
- Running scheduled jobs that require fresh authentication tokens to access MI2U APIs.
Example use case:
- A workflow that logs into MI2U, retrieves the authentication cookie, and then passes it to another node that fetches invoices or customer data.
Properties
| Name | Meaning |
|---|---|
| Username | The email address associated with your Myinvoice2u account. |
| Password | The password for your Myinvoice2u account. |
| Log Response Details | Boolean flag to enable detailed logging of the login request and response information. |
Output
The node outputs the input items enriched with additional JSON fields containing authentication details:
cookie: The authentication cookie string received from the MI2U login response headers.authenticationCookie: Same ascookie, provided for convenience.json_error: Alwaysfalsehere, indicating no JSON parsing error occurred.statusCode: HTTP status code returned by the login request.statusMessage: HTTP status message returned by the login request.
These fields are added to each item’s JSON data, allowing downstream nodes to use the authentication cookie for further API requests.
No binary data output is produced by this node.
Dependencies
- Requires internet access to call the MI2U API endpoint at
https://ics-uat.myinvoice2u.com/MYWs/ws/api/getToken. - Needs valid MI2U account credentials (email and password).
- No external npm packages beyond n8n core dependencies are required.
- No special environment variables or n8n credential types are needed; credentials are entered directly as node parameters.
Troubleshooting
- Missing Credentials: If username or password is not provided, the node throws an error stating both are required.
- Login Failure - No Cookie Received: If the login response does not contain a cookie header, the node throws an error indicating login failure.
- Network Issues: Connectivity problems or incorrect API URL may cause HTTP request failures.
- Incorrect Credentials: Invalid username or password will result in unsuccessful login and no cookie returned.
- Enable Logging: Use the "Log Response Details" property to get detailed console logs for debugging login issues.
Links and References
- Myinvoice2u Official Website
- MI2U API documentation (if available internally or from MI2U support)
- n8n HTTP Request Helper Documentation: https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.httpRequest/