Overview
This node, named "User Update - UNEXO," is designed to modify user fields by sending update requests to an external API. It takes user data and a JSON-formatted string describing modifications, then applies these changes to each user by calling a remote service endpoint. This node is useful in scenarios where you need to programmatically update user attributes or other profile information in bulk, such as updating last names, adding custom attributes, or synchronizing user data with an external system.
Practical examples include:
- Updating user profile fields after a batch import.
- Adding or modifying custom attributes for users based on business logic.
- Synchronizing user data changes from one system to another via API.
Properties
| Name | Meaning |
|---|---|
| Modifications | A JSON-formatted string specifying the user fields to be updated. Supports dynamic expressions referencing input data. Example: { "lastName": "lastNameValue", "attributes": { "attr": "attr1" } } |
| Users | A string representing users to update. If left blank, the node uses users from the previous node's output. |
Output
The node outputs a JSON array containing the response from the external API after attempting to update the users. The structure of the output JSON depends on the API response but generally includes the result of the update operation for each user.
No binary data output is produced by this node.
Dependencies
- Requires an environment variable
CDP_URLthat defines the base URL of the external API. - Requires an environment variable
UNEXO_API_KEYwhich is used as a Bearer token for authorization when making API requests. - The node makes HTTP POST requests to the endpoint
${CDP_URL}/api/users/updateUsers.
Troubleshooting
Common issues:
- Missing or incorrect
CDP_URLorUNEXO_API_KEYenvironment variables will cause authentication or connection failures. - Malformed JSON in the "Modifications" property can lead to errors when sending the request.
- If the "Users" property is empty and the previous node does not provide user data, the node may fail due to missing user IDs.
- Missing or incorrect
Error messages:
- Authorization errors typically indicate invalid or missing API keys.
- HTTP request failures might indicate network issues or incorrect API URLs.
- JSON parsing errors suggest invalid JSON formatting in the "Modifications" input.
To resolve these:
- Ensure environment variables are correctly set.
- Validate JSON syntax before running the node.
- Confirm that input data contains valid user identifiers.
Links and References
- No direct links provided in the source code. For more information, consult the documentation of the external API at the URL specified by
CDP_URL.