API Authentication in Insomnia
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
‎02-15-2022 01:52 PM
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.
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.
3 REPLIES 3
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
‎02-16-2022 11:51 AM
Hi Byron,
Here the way to chain requests in Insomnia.
Regards
Mig
Here the way to chain requests in Insomnia.
Regards
Mig
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
‎02-16-2022 04:16 AM
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
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
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
‎02-16-2022 11:07 AM
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.
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.
