Ajax icon

Ajax

Consume Ajax API (v.0.1.2)

Actions242

Overview

The "Updates Company Employee" operation within the Employee Management resource allows users to update details of an existing employee in a specified company. This node is useful for scenarios where employee information needs to be maintained or corrected, such as updating contact details, roles, status, or other metadata related to an employee.

Practical examples include:

  • Changing an employee's role after a promotion.
  • Updating phone numbers or email addresses.
  • Modifying the employment status (e.g., from PENDING to ACTIVE).
  • Adding or changing the employee's photo ID or user ID.

This operation ensures that employee records remain current and accurate within the company's system.

Properties

Name Meaning
Company Id The unique identifier of the company to which the employee belongs.
Employee Id The unique identifier of the employee whose data is being updated.
First Name The employee's first name.
Last Name The employee's last name.
Additional Fields Optional fields to provide extra information about the employee. These include:
- Id An additional identifier for the employee record.
- Version Numeric version of the employee record, possibly for concurrency control.
- User Id Identifier linking the employee to a user account.
- Email Employee's email address.
- Phone Numbers One or more phone numbers associated with the employee. Each number is provided as a string.
- Photo Id Identifier for the employee's photo.
- Role One or more roles assigned to the employee. Possible roles are: OWNER, SENIOR_CMS_ENGINEER, CMS_ENGINEER, HEAD_OF_INSTALLERS, INSTALLER, HEAD_OF_OPERATORS, OPERATOR, RAPID_RESPONSE_TEAM.
- Status Employment status of the employee. Options include: PENDING, CANCELLED, INACTIVE, ACTIVE.
- Created Date Timestamp (in milliseconds since epoch) indicating when the employee record was created.
- Last Modified Date Timestamp (in milliseconds since epoch) indicating the last modification time of the employee record.

Output

The node outputs JSON data representing the updated employee record after the operation completes successfully. This output includes all the fields sent in the update request, reflecting the current state of the employee in the system.

If the node supports binary data output (not explicitly shown in the provided code), it would typically relate to employee photos or attachments, but no explicit binary output handling is indicated here.

Dependencies

  • Requires an API key credential to authenticate requests to the backend Ajax API service.
  • Depends on the backend HTTP client and state management modules bundled within the node implementation.
  • The node uses a resolver and executor pattern to map operations to backend methods, requiring proper configuration of these components.
  • No external environment variables are explicitly required beyond the API authentication credential.

Troubleshooting

  • Missing Required Fields: Errors may occur if mandatory fields like Company Id, Employee Id, First Name, or Last Name are not provided. Ensure all required inputs are filled.
  • Invalid Role or Status Values: Providing values outside the predefined options for roles or status can cause validation errors.
  • API Authentication Failures: If the API key credential is missing or invalid, the node will fail to connect to the backend service.
  • Version Conflicts: If the version field is used for concurrency control, mismatched versions might cause update failures.
  • Date Format Issues: Created Date and Last Modified Date must be provided as numeric timestamps; incorrect formats may lead to errors.

To resolve these issues:

  • Double-check input parameters for completeness and correctness.
  • Verify the API key credential is correctly configured and has necessary permissions.
  • Use valid option values for enumerated fields.
  • Confirm date fields are numeric timestamps.

Links and References

  • No direct external links are provided in the source code.
  • For further details, consult the documentation of the backend Ajax API service used by this node.
  • Refer to n8n documentation on creating and configuring custom nodes for API integrations.

Discussion