Issue to launch import (cumstom ?) script (v3.0.5) #12155
-
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 8 replies
-
|
Try to add a print after loading the json: json_data = json.loads(data.text)
print(json_data)That might shed some light on what's wrong. |
Beta Was this translation helpful? Give feedback.
-
|
Thanks for your reply it seems it doesn't print anything the full_url is giving the api result with all the data |
Beta Was this translation helpful? Give feedback.
-
|
That code doesn't check the response from Netbox. Try modifying as follows: The first will print the status code, so you can check if it's 200/4xx/5xx etc. The second will raise an exception if the status code is 4xx or 5xx. Reference |
Beta Was this translation helpful? Give feedback.
-
|
Hi, Waow many thanks for looking into it. So it gives me a 403 error, so that means that the API is using a token from a disabled used ? It's possible because the guy who did this as left and his AD account has been deleted In the Netbox.py i can see this at the top : So i need to replace this token ? I hope i'm following you guys. Edit : I have generate a new token with an active user, update the header but i'm still getting 403 |
Beta Was this translation helpful? Give feedback.



Hi,
Waow many thanks for looking into it.
So it gives me a 403 error, so that means that the API is using a token from a disabled used ? It's possible because the guy who did this as left and his AD account has been deleted
In the Netbox.py i can see this at the top :
So i need to replace this token ? I hope i'm following you guys.
Edit : I have generate a new token with an active user, update the header but i'm still getting 403