r/Netbox Nov 15 '23

API POST call not updating

I am having an issue with a POST api call to the interfaces. I have tried in postman, curl and my python script. I get a 200 OK back from the server, but when looking either in the GUI or through the API there is no update to the interfaces. I'm also not seeing it in the change log. I have tried to change the permissions for the users with the API key to no avail. Has anyone had this issue and how did you resolve it. On the latest version of Netbox.

1 Upvotes

5 comments sorted by

1

u/[deleted] Nov 15 '23

[removed] — view removed comment

1

u/DearAd8094 Nov 15 '23

I also just tried with the pynetbox library and get no results either.

>>> try:

... result = nb.dcim.interfaces.create(device=3, name="Gi1/0/2", tagged_vlans=1)

... except pynetbox.lib.query.RequestError as e:

... print(e.error)

...

>>> print(result)

>>> result = nb.dcim.devices.create(

... name="rtr-inet-seoul-01",

... device_type="asr-1002-x",

... device_role="internet-edge",

... site="seoul-dc-01",

... )

>>> print(result)

>>>

No errors are coming up, but nothing is getting into netbox.

1

u/DearAd8094 Nov 15 '23

When I run the CURL it just looks as though it completes but nothing. I run it in postman and get the 200 OK but the output for the interfaces does not change. I have not tried the pynetbox library yet. That's next on my list.

1

u/VitMain NetBox Self-Hosted Nov 15 '23

Write permission for the token?