03-25-2024 01:45 AM
Hello,
I was exploring the API functionallity of the Extreme Management Center through the built in nbi explorer, since we are migrating to the newer XIQ Site Engine it would be useful to be able to transfer data between them.
I did create a simple python script just to verify basic access to the API.
I am getting the access token from the ems, but when trying to post the query to the /nbi/graphql endpoint, i am getting a 401 Unauthorized back. I even tried including the same credentials as i used for aquiring the initial access_token, but no luck there either.
The query in question:
query {network {devices { up ip sysName siteData { siteId siteName location }}}}
Solved! Go to Solution.
03-26-2024 08:10 AM
I still not get, why you not use the existing Python class.
However, you added a equal sign where no equal sign should be
03-26-2024 08:10 AM
I still not get, why you not use the existing Python class.
However, you added a equal sign where no equal sign should be
03-26-2024 07:59 AM
I still not get why you are not using the existing Python class.
However I found two issues in your code.
1. if you using a object oriented programming like a session in requests, you cannot update the header like you do.
Upper example is your wrong one, the lower one is the correct way to do it.
2. you nbi_query is malformed according to the documentation. The XIX-SE tolerate such malformed call, but is better to have it clean. The outer curly brackets are missing.
03-27-2024 05:43 AM
Thank you very much, i corrected the two issues you mentioned. I am now able to pull the data from the API, Many thanks!