iDebugAll / phonebox_plugin

A Telephone Number Management Plugin for Netbox and more
MIT License
89 stars 26 forks source link

Adding Tags to number through PATCH request does not add tags #39

Open RickWinters opened 1 year ago

RickWinters commented 1 year ago

When adding tags through the API with a PATCH request on /api/plugins/phonebox/numbers/{id}, the API response will show the correct tags but looking in the history on Netbox there are no tags added. They will also not be visible in the netbox UI. As you can see in this URL the PATCH request body only contains "{tags: [40, 41]}". These are 2 ID's of existing tags (/api/extras/tags/) The Response does show the complete Tag object. I blurred out any personal information such as the start of the URL, Usernames and Phonenumbers for privacy reasons image

The netbox UI for changelogs only shows an update on the 'Created' field, only changing the datetime format. image

KeyDutch404 commented 2 months ago

Hello! I have the same problem when adding tags using pyhton and pynetbox library. I can get a tag but can't add it.

from pynetbox import api
from config import NETBOX_TOKEN, NETBOX_URL
nb = api(NETBOX_URL, token=NETBOX_TOKEN)

num = nb.plugins.phonebox.numbers.get(number='7751230')
print(num.tags)
num.tags.append(22)
num.save()
print(num.tags)
num = nb.plugins.phonebox.numbers.get(number='7751230')
print(num.tags)

print1 [incoming] print2 [incoming, 22] print3 [incoming]