Extreme Campus Controller

 View Only
  • 1.  API Authentication in Insomnia

    Posted 02-15-2022 13:52
    Hi Guys,

    I'm trying to use insomnia to use XCC api but I keep getting 401 unauthorized error.

    I have the authentication set to Bearer but I'm not sure what to put in for the token or prefix.

    I create an API key for the admin user in XCC and pasted that into the token field but that doesn't work.


  • 2.  RE: API Authentication in Insomnia

    Posted 02-16-2022 04:16
    Hi Byron

    First you must do a POST and send username/password to the controller which asks the controller to generate a time-limited token for you, once you have this token (a very long string) you copy/paste that into the token value in the bearer, the token is used to authenticate future REST API calls, see below:


    HTH 

    -Gareth


  • 3.  RE: API Authentication in Insomnia

    Posted 02-16-2022 11:07
    Edited by Byron Morales 02-16-2022 11:18
    Hi Gareth,

    Thanks for getting back to me. I was able to figure out by using curl to send the post and passing the json file with my credentials, but I was wondering how to do the same in insomnia which I now understand from your screenshot. I played around with adding APs in bulk to XCC and it worked out great. I'm really loving the flexibility this is going to create as I dive deeper into the API's available and how I manage our end customers. 

    I have a question on the reauth token though. I was able to send the POST using the reauth token and saw that I get a new token and new reauth token, but is there a way to make make the token persistent or not expire? I'm wondering how I'm supposed to update the authentication token if I want to run API's calls on a schedule.


  • 4.  RE: API Authentication in Insomnia

    Posted 02-16-2022 11:51
    Hi Byron,
    Here the way to chain requests in Insomnia.
    Regards

    Mig