cancel
Showing results for 
Search instead for 
Did you mean: 

Access tokens not working

Access tokens not working

gabrielb
New Contributor
Hello everyone, I'm switching to the new API and I'm having trouble getting the authorization/Authentication token to work. I'm currently using the Access token provided by the XIQ dashboard, like it was on the old API, but now I keep getting the 'JWT strings must contain exactly 2 period characters. Found: 0' error everytime I try calling the auth/apitoken endpoint to get the API Token. I noticed the token I'm supposed to have should be a three part one, but couldn't generate one on the dashboard and also couldn't find a good example/explanation on how to proper use/generate it. Does anyone know how to properly get the access/authorization token or have a guide I can follow?

Any help is welcome, thanks
1 ACCEPTED SOLUTION

Paul_Wang
Extreme Employee
@gabriel baima,

The token you got from XIQ Global Setting page is for old API only. To get the access token for the new API, you can call the end point "/login" on https://api.extremecloudiq.com. Once you get the access code, you use it as part of the Bearer Authorization header when calling other API endpoints. The following are examples.

Login to get the access code:

curl -X POST "https://api.extremecloudiq.com/login" -H "accept: application/json" -H "Content-Type: application/json" -d "{\"username\":\"${USERNAME}\",\"password\":\"${PASSWORD}\"}"

List the admin users with the access code:

curl -X GET "https://api.extremecloudiq.com/users?page=1&limit=10" -H "accept: application/json" -H "Authorization: Bearer ${ACCESS_CODE}"

You can test the New API on the following Swagger site directly.

https://api.extremecloudiq.com/swagger-ui/index.html?configUrl=/openapi/swagger-config#/

References:

https://extremecloudiq.com/api-docs/api-docs.html#_authentication
https://developer.extremecloudiq.com/​

View solution in original post

1 REPLY 1

Paul_Wang
Extreme Employee
@gabriel baima,

The token you got from XIQ Global Setting page is for old API only. To get the access token for the new API, you can call the end point "/login" on https://api.extremecloudiq.com. Once you get the access code, you use it as part of the Bearer Authorization header when calling other API endpoints. The following are examples.

Login to get the access code:

curl -X POST "https://api.extremecloudiq.com/login" -H "accept: application/json" -H "Content-Type: application/json" -d "{\"username\":\"${USERNAME}\",\"password\":\"${PASSWORD}\"}"

List the admin users with the access code:

curl -X GET "https://api.extremecloudiq.com/users?page=1&limit=10" -H "accept: application/json" -H "Authorization: Bearer ${ACCESS_CODE}"

You can test the New API on the following Swagger site directly.

https://api.extremecloudiq.com/swagger-ui/index.html?configUrl=/openapi/swagger-config#/

References:

https://extremecloudiq.com/api-docs/api-docs.html#_authentication
https://developer.extremecloudiq.com/​
GTM-P2G8KFN