NetXMS Support Forum

English Support => General Support => Topic started by: Benjamin Dill on September 19, 2024, 02:27:00 PM

Title: Bug in WebApi for zone objects?
Post by: Benjamin Dill on September 19, 2024, 02:27:00 PM
We are using the WebApi for creating different objects. Creating new nodes or containers works without problems, but the API returns an error when creating a new zone. We are sending this JSON:

{
    objectType: 6
    name: "NewZone"
    parentId: 1
}
We are setting parentId = 1, because the object "Entire Network" has object id 1. This returns an "Internal error" with code 46.

I did take a look at the code and it seems impossible to create a node with parentId = 1.
https://github.com/netxms/netxms/blob/62c5f9ec1837c93023a40a71781ea2c73037b4c9/src/client/nxapisrv/java/src/main/java/org/netxms/websvc/handlers/Objects.java#L377

Can you check this?
Title: Re: Bug in WebApi for zone objects?
Post by: Filipp Sudanov on September 25, 2024, 02:18:58 PM
Created https://track.radensolutions.com/issue/NX-2596 for this
Title: Re: Bug in WebApi for zone objects?
Post by: Victor Kirhenshtein on October 08, 2024, 03:06:16 PM
Just fixed it. Official fix will be in 5.1, but if you need it to work in 5.0, you can rebuild web API from source branch stable-5.0 - fix is backported here as well.

Best regards,
Victor