Ajax icon

Ajax

Consume Ajax API (v.0.1.2)

Actions242

Overview

This node interacts with the Ajax API to update user permissions related to device access within a company and hub context. Specifically, for the "User" resource and the operation "Update Permission On Behalf Of UserId For CompanyId On Hub For Photo," it allows modifying availability conditions and device permissions on behalf of a specified user.

Common scenarios include:

  • Managing security or monitoring system user permissions programmatically.
  • Adjusting device access rights dynamically based on operational needs.
  • Automating permission updates after certain events (e.g., alarms).

Practical example:

  • An administrator wants to set a user's camera access to be available only if the device is armed, for a specific company and hub, and specify which devices the user can access.

Properties

Name Meaning
User Id The unique identifier of the user whose permissions are being updated.
Hub Id The identifier of the hub where the devices are located.
Company Id The identifier of the company associated with the user and devices.
Availability Condition Defines when the user’s permission is active. Options: NEVER_AVAILABLE, ALWAYS_AVAILABLE, AVAILABLE_IF_DEVICE_ARMED, AVAILABLE_AFTER_ALARM.
Devices A collection of devices specifying which devices the permission applies to. Each device includes: Device Id (identifier) and Object Type (type of device). Object Types include MOTION_CAM_PHOD, MOTION_CAM_OUTDOOR_PHOD, MOTION_CAM_PHOD_FIBRA.
After Alarm Availability Minutes Number of minutes the permission remains available after an alarm event. Required only if Availability Condition is AVAILABLE_AFTER_ALARM. Options typically include 5, 10, 15, or 30 minutes. Optional otherwise.

Output

The node outputs JSON data representing the result of the permission update operation. This typically includes confirmation of the updated permissions, status codes, or error messages from the Ajax API.

If binary data is returned by the API (not indicated in this operation), it would represent files or media related to the devices or users, but this operation focuses on permission updates and thus primarily outputs JSON.

Dependencies

  • Requires an API key credential for authenticating with the Ajax API.
  • Depends on the Ajax backend services to perform permission updates.
  • Uses internal helper classes for HTTP communication, state management, and operation execution.
  • No additional environment variables are explicitly required beyond the API authentication.

Troubleshooting

  • Missing or invalid credentials: Ensure that the API key credential is correctly configured and has sufficient permissions.
  • Invalid IDs: Errors may occur if User Id, Hub Id, or Company Id do not exist or are mistyped.
  • Incorrect availability condition or missing after-alarm minutes: If AVAILABLE_AFTER_ALARM is selected without specifying valid minutes, the operation may fail.
  • Device list issues: Providing empty or malformed device entries could cause errors; ensure each device has a valid Device Id and Object Type.
  • API errors: Network issues or server-side problems may result in failed requests; check connectivity and API status.

Links and References


Note: This summary is based solely on static analysis of the provided source code and property definitions. Runtime behavior and dynamic responses depend on the actual API and environment configuration.

Discussion