cancel
Showing results for 
Search instead for 
Did you mean: 

XMC API Authentication

XMC API Authentication

Johnny69
New Contributor II

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 }}}}

1 ACCEPTED SOLUTION

I still not get, why you not use the existing Python class.

However, you added a equal sign where no equal  sign should be

Markus_Nikulski_0-1711465846423.png

 

View solution in original post

7 REPLIES 7

I still not get, why you not use the existing Python class.

However, you added a equal sign where no equal  sign should be

Markus_Nikulski_0-1711465846423.png

 

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.

Markus_Nikulski_2-1711465126217.png

 

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.

Markus_Nikulski_1-1711465072587.png

 







Thank you very much, i corrected the two issues you mentioned. I am now able to pull the data from the API, Many thanks!

GTM-P2G8KFN