Mira Device Get By Library
AI-generatedOverview
The "Mira Device Get By Library" node retrieves a list of devices associated with a specific library from the Mira App Server. It is useful in scenarios where you need to fetch device information grouped by library, such as inventory management, monitoring device status, or integrating device data into workflows.
For example, if you manage multiple libraries and want to automate reporting or trigger actions based on devices available in a particular library, this node can query the Mira server and return all relevant devices for that library.
Properties
| Name | Meaning |
|---|---|
| Token Source | Choose where to get the access token from: either from stored credentials or from input data. |
| Server URL | The URL of the Mira App Server (required if token source is "From Input Data"). |
| Access Token | The access token used for authentication, either provided directly or via input data. |
| Library ID | The unique identifier of the library for which to retrieve devices (required). |
Output
The node outputs JSON data containing:
libraryId: The ID of the library queried.devices: An array of device objects returned by the Mira App Server for the specified library.count: The number of devices retrieved.timestamp: The ISO timestamp when the data was fetched.operation: A string indicating the operation performed, here always"getByLibrary".
No binary data output is produced by this node.
Example output structure:
{
"libraryId": "library-123",
"devices": [
{
"id": "device-1",
"name": "Device One",
...
},
{
"id": "device-2",
"name": "Device Two",
...
}
],
"count": 2,
"timestamp": "2024-06-01T12:00:00.000Z",
"operation": "getByLibrary"
}
Dependencies
- Requires access to a Mira App Server instance reachable at the configured Server URL.
- Requires an access token for authentication, either supplied via credentials or input data.
- Uses internal helper functions to handle HTTP requests and token management.
Troubleshooting
- Missing or empty Library ID: The node will throw an error if the Library ID parameter is missing or empty. Ensure this field is correctly set.
- Authentication errors: If the access token is invalid or missing, the request to the Mira server will fail. Verify the token source and token value.
- Server connectivity issues: If the Mira App Server URL is incorrect or unreachable, the node will not be able to fetch devices. Confirm network connectivity and server availability.
- Unexpected response format: If the server returns data not in the expected format (e.g., not an array), downstream processing might fail or produce incorrect counts.
Links and References
- Mira App Server API documentation (if available) for
/api/devices/library/{libraryId}endpoint. - n8n documentation on creating custom nodes and handling credentials.