Is the Nx Cloud up? Visit our Status Page for the current health and performance of the Nx Cloud.

Status Page

HTTPS Request to Python Flask

Answered

Comments

3 comments

  • Ichiro
    • Network Optix team

    Hi Fandra Andito

    Thank you for your question.

    The HTTP 400 error is likely due to an issue in your Python script can't deal with requests, most likely, the request is missing a POST body. Since we don't know the specifics of your script, I recommend you can review your code to ensure it’s handling the request correctly.

    Regarding placeholders for Generic Events or Analytics Events, these have been supported since Nx Witness v4.1. For more details, please refer to the release notes: Nx Witness Release Notes.

     

    For metadata, such as obtaining object types like car or motorcycle, this may not be accessible via your current approach, as metadata is transmitted via RTSP instead of event notifications from the camera. You might need to use the metaSDK, or you can wait for our metadata API, expected around Q1/2025, which will allow you to integrate notifications and metadata directly with your Python code.

     

    Thanks.

     

    1
  • Fandra Andito

    Hello Ichiro,

    Thank you for your response.

    Actually, I’m also not sure what exactly to write in the Python code, as I don’t know which parameters I need to retrieve. I appreciate your explanation as well. Based on what you’ve said, would it be better for me to use a Python post-processor to send the data? If so, how should I split the logic between post-processor.py and api.py (as an example)?

    Looking forward to your answer.

    1
  • Ichiro
    • Network Optix team

    Hi 

    You may refer to the sample here on Nx Open github.

    If so, how should I split the logic between post-processor.py and api.py (as an example)?

    To be honest, this question might be best answered by your mentor/engineering lead or a senior staff member within your company. Implementation approaches can vary across companies based on internal logic and preferences.

    In general, api.py can be treated as a simple library that contains commonly used functions, similar to how you would import modules like json or requests.

    1

Please sign in to leave a comment.