Triggering inference in a 3rd party REST based analytics integration from Nx Witness Client UI
PlannedHi everyone,
I have integrated a third-party analytics application with Nx Witness using the Nx REST API.
So far, the workflow is as follows:
- Register the integration using the Nx REST API.
- Manually trigger analytics inference from my analytics application.
- Retrieve inference metadata (for example, bounding boxes) from the analytics application and send it to Nx via the REST API.
- Enable object visualization on the device UI in the Nx Client to display the bounding boxes.
Currently, the analytics inference is triggered outside the Nx ecosystem. My analytics application exposes its own REST API endpoint that starts the analytics processing.
What I would like to achieve is triggering the analytics run directly from the Nx Witness Client UI. For example, a user could select a few parameters like confidence thresholds etc. in the device integration tab and click Apply, which would then communicate with my analytics application and initiate the inference process automatically.
Has anyone implemented a similar workflow, or is there a recommended way to trigger external analytics processing from the Nx Witness Client UI?
Any suggestions or guidance would be greatly appreciated.
Thanks!
-
Hi Sajeev,
Yes, this is doable. What you need is the settings manifest, which is the data structure each Analytics Engine's DeviceAgent returns to the Server after it's created.
The field descriptions are in
/server_plugin_sdk/src/nx/sdk/settings_model.mdinside the SDK.
Once you have the manifest defined in JSON, push it via the API:
-
POST /rest/v4/analytics/engines/{id}/manifest— site-level (Engine) -
POST /rest/v4/analytics/engines/{engineId}/deviceAgents/{deviceId}/manifest— device-specific (deviceAgent)
For an external analytics service integration, site-level (Engine manifest) is usually the right scope. For your threshold use case, a
SpinBoxorDoubleSpinBoxtype would work.After setting the manifest, use:
GET /rest/v4/analytics/engines/{id}/settings
to read back the current values.
One important note: these Analytics APIs only apply to integrations created via the API. SDK/plugin-based integrations cannot use these endpoints.
0 -
-
Thanks for the response.
Does it mean my analytics integration needs to keep polling
GET /rest/v4/analytics/engines/{id}/settingsfor any change in the settings. And once user updates relevant fields/checkboxes in the device settings in the UI, based on the updated manifest, I can then trigger my inference run ?0 -
Hi Sajeev,
Usually, you may poll the endpoint but we also provide the JSON-RPC for callback.
https://meta.nxvms.com/doc/developers/api-tool/analytics-api-callbacks-1?type=1

I might suggest use websocket connection with JSON-RPC in your use case.
Thanks.0
Please sign in to leave a comment.
Comments
3 comments