<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Problem with API Token and XIQ in ExtremeCloud IQ</title>
    <link>https://community.extremenetworks.com/t5/extremecloud-iq/problem-with-api-token-and-xiq/m-p/118477#M4590</link>
    <description>&lt;P&gt;Hi Jonas, Thanks for your answer.&lt;/P&gt;&lt;P&gt;I've been able to read all the data I wanted from the very beginning using the first "login" token I had generated. The reason why I tried generating an &lt;EM&gt;authorization&lt;/EM&gt; token is because I was getting the error&amp;nbsp;{"message":"401 Unauthorized: Invalid Token"} when trying to&amp;nbsp;&lt;STRONG&gt;create a new user group&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;From my Python script, or from the command line, when I do (by following &lt;A href="https://extremecloudiq.com/api-docs/api-reference.html#_create_user_group" target="_blank"&gt;https://extremecloudiq.com/api-docs/api-reference.html#_create_user_group&lt;/A&gt;) :&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;#curl 'https://api.extremecloudiq.com/usergroups' -i -X POST -H 'Authorization: Bearer &amp;lt;myToken&amp;gt;'
-H 'Content-Type: application/json'
-d '{
  "name": "UG_IOTW_2025_Week_14",
  "description": "string",
  "password_db_location": "CLOUD",
  "ppsk_use_only": true,
  "password_type": "PPSK",
  "enable_max_clients_per_ppsk": true,
  "max_clients_per_ppsk": 0,
  "pcg_use_only": false,
  "pcg_type": "AP_BASED",
  "enable_cwp_reg": false,
  "password_settings": {
    "enable_letters": true,
    "enable_numbers": true,
    "enable_special_characters": true,
    "password_concat_string": "string",
    "psk_generation_method": "PASSWORD_ONLY",
    "password_character_types": "INCLUDE_ALL_CHARACTER_TYPE_ENABLED",
    "password_length": 0
  },
  "expiration_settings": {
    "expiration_type": "VALID_DURING_DATES",
    "valid_during_dates": {
      "start_date_time": {
        "day_of_month": 31,
        "month": 3,
        "year": 2025,
        "hour_of_day": 3,
        "minute_of_hour": 0
      },
      "end_date_time": {
        "day_of_month": 7,
        "month": 4,
        "year": 2025,
        "hour_of_day": 3,
        "minute_of_hour": 0
      },
      "time_zone": "string"
    },
    "expiration_action": "SHOW_MESSAGE",
    "post_expiration_action": {
      "enable_credentials_renewal": false,
      "enable_delete_immediately": true,
      "delete_after_value": 0,
      "delete_after_unit": "MINUTE"
    }
  },
  "delivery_settings": {
    "email_template_id": 0,
    "sms_template_id": 0
  }
}'&lt;/LI-CODE&gt;&lt;P&gt;I get the following answer :&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;HTTP/2 401 
server: nginx
date: Fri, 11 Apr 2025 08:48:54 GMT
content-type: application/json

{"message":"401 Unauthorized: Invalid Token"}&lt;/LI-CODE&gt;&lt;P&gt;Like I was saying, I tried that with my login token (which has full rights indeed, I verified) and with a new authorization token with the same result.&lt;/P&gt;&lt;P&gt;So, write permissions problem ?&lt;/P&gt;&lt;P&gt;I have no clue and hope you'll see light where I am still in the dark.&lt;/P&gt;&lt;P&gt;Thx in advance,&lt;/P&gt;&lt;P&gt;Thierry&lt;/P&gt;</description>
    <pubDate>Fri, 11 Apr 2025 08:58:42 GMT</pubDate>
    <dc:creator>Thilroy</dc:creator>
    <dc:date>2025-04-11T08:58:42Z</dc:date>
    <item>
      <title>Problem with API Token and XIQ</title>
      <link>https://community.extremenetworks.com/t5/extremecloud-iq/problem-with-api-token-and-xiq/m-p/118448#M4588</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;This is the second post I write about the subject since (sheesh!) last friday because the first one was marked as "spam" and the moderators are obviously too busy to look at my abuse report. Well, here it goes :&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;I am using python scripts to try and automate some XIQ-related tasks, like User Group creation, but I am getting the message : {"message":"401 Unauthorized: Invalid Token"}.&lt;/P&gt;&lt;P&gt;Basically, what I do is first a login with a POST to &lt;A href="https://api.extremecloudiq.com/login," target="_blank" rel="noopener nofollow noreferrer"&gt;https://api.extremecloudiq.com/login,&lt;/A&gt; and that provides me with a token that I can use for getting infos like /devices, /usergroups, allright.&lt;/P&gt;&lt;P&gt;If I understand correctly, I need another &lt;EM&gt;authorization&amp;nbsp;&lt;/EM&gt;token if I want to perform a &lt;EM&gt;create user group&lt;/EM&gt; operation.&lt;/P&gt;&lt;P&gt;I am not sure of the permission I need for that, but it seemed pretty logical to ask something like that :&lt;BR /&gt;{"expire_time": int(time.time())+1000, "description": "API Token with write permissions.", "permissions" : [ "usergroup" ]}, since "usergroup" gives you : &lt;SPAN&gt;"description"&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;SPAN&gt;"Full control of user group".&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I indeed get a new token, with other permissions as well (there are a lot !!!) but&lt;/SPAN&gt;&lt;SPAN&gt; always do get the same result, which is {"message":"401 Unauthorized: Invalid Token"} when I try to create my group based on the following json file :&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;#edited out because of the lousy anti-spam robot&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&lt;SPAN&gt;Could someone tell me where I am wrong ?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks in advance,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thierry.&lt;/SPAN&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 08 Apr 2025 13:26:11 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/extremecloud-iq/problem-with-api-token-and-xiq/m-p/118448#M4588</guid>
      <dc:creator>Thilroy</dc:creator>
      <dc:date>2025-04-08T13:26:11Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with API Token and XIQ</title>
      <link>https://community.extremenetworks.com/t5/extremecloud-iq/problem-with-api-token-and-xiq/m-p/118470#M4589</link>
      <description>&lt;P&gt;Hi with the access token you get from the login you can do the requests. You can indeed ask for a new api token with different rights. But the first have generated have enough rights.&lt;BR /&gt;&lt;BR /&gt;You can test it by going to&amp;nbsp;&lt;A href="https://api.extremecloudiq.com/swagger-ui/index.html#/Authentication/login" target="_blank"&gt;https://api.extremecloudiq.com/swagger-ui/index.html#/Authentication/login&lt;/A&gt;&amp;nbsp;-- Click on Try it out -- Fill in user name and password -- now you can go to&amp;nbsp;&lt;A href="https://api.extremecloudiq.com/swagger-ui/index.html#/Configuration%20-%20User%20Management/listUserGroups" target="_blank"&gt;https://api.extremecloudiq.com/swagger-ui/index.html#/Configuration%20-%20User%20Management/listUserGroups&lt;/A&gt;&amp;nbsp;and try if you are able to get all the user groups. (normally he remembers the api token from first request)&lt;BR /&gt;&lt;BR /&gt;You can also check which permission this access token has. Maybe you can learn which permissions you want:&amp;nbsp;&lt;A href="https://api.extremecloudiq.com/swagger-ui/index.html#/Authorization/listPermissions" target="_blank"&gt;https://api.extremecloudiq.com/swagger-ui/index.html#/Authorization/listPermissions&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Apr 2025 17:49:35 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/extremecloud-iq/problem-with-api-token-and-xiq/m-p/118470#M4589</guid>
      <dc:creator>JonasD_Complit</dc:creator>
      <dc:date>2025-04-10T17:49:35Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with API Token and XIQ</title>
      <link>https://community.extremenetworks.com/t5/extremecloud-iq/problem-with-api-token-and-xiq/m-p/118477#M4590</link>
      <description>&lt;P&gt;Hi Jonas, Thanks for your answer.&lt;/P&gt;&lt;P&gt;I've been able to read all the data I wanted from the very beginning using the first "login" token I had generated. The reason why I tried generating an &lt;EM&gt;authorization&lt;/EM&gt; token is because I was getting the error&amp;nbsp;{"message":"401 Unauthorized: Invalid Token"} when trying to&amp;nbsp;&lt;STRONG&gt;create a new user group&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;From my Python script, or from the command line, when I do (by following &lt;A href="https://extremecloudiq.com/api-docs/api-reference.html#_create_user_group" target="_blank"&gt;https://extremecloudiq.com/api-docs/api-reference.html#_create_user_group&lt;/A&gt;) :&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;#curl 'https://api.extremecloudiq.com/usergroups' -i -X POST -H 'Authorization: Bearer &amp;lt;myToken&amp;gt;'
-H 'Content-Type: application/json'
-d '{
  "name": "UG_IOTW_2025_Week_14",
  "description": "string",
  "password_db_location": "CLOUD",
  "ppsk_use_only": true,
  "password_type": "PPSK",
  "enable_max_clients_per_ppsk": true,
  "max_clients_per_ppsk": 0,
  "pcg_use_only": false,
  "pcg_type": "AP_BASED",
  "enable_cwp_reg": false,
  "password_settings": {
    "enable_letters": true,
    "enable_numbers": true,
    "enable_special_characters": true,
    "password_concat_string": "string",
    "psk_generation_method": "PASSWORD_ONLY",
    "password_character_types": "INCLUDE_ALL_CHARACTER_TYPE_ENABLED",
    "password_length": 0
  },
  "expiration_settings": {
    "expiration_type": "VALID_DURING_DATES",
    "valid_during_dates": {
      "start_date_time": {
        "day_of_month": 31,
        "month": 3,
        "year": 2025,
        "hour_of_day": 3,
        "minute_of_hour": 0
      },
      "end_date_time": {
        "day_of_month": 7,
        "month": 4,
        "year": 2025,
        "hour_of_day": 3,
        "minute_of_hour": 0
      },
      "time_zone": "string"
    },
    "expiration_action": "SHOW_MESSAGE",
    "post_expiration_action": {
      "enable_credentials_renewal": false,
      "enable_delete_immediately": true,
      "delete_after_value": 0,
      "delete_after_unit": "MINUTE"
    }
  },
  "delivery_settings": {
    "email_template_id": 0,
    "sms_template_id": 0
  }
}'&lt;/LI-CODE&gt;&lt;P&gt;I get the following answer :&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;HTTP/2 401 
server: nginx
date: Fri, 11 Apr 2025 08:48:54 GMT
content-type: application/json

{"message":"401 Unauthorized: Invalid Token"}&lt;/LI-CODE&gt;&lt;P&gt;Like I was saying, I tried that with my login token (which has full rights indeed, I verified) and with a new authorization token with the same result.&lt;/P&gt;&lt;P&gt;So, write permissions problem ?&lt;/P&gt;&lt;P&gt;I have no clue and hope you'll see light where I am still in the dark.&lt;/P&gt;&lt;P&gt;Thx in advance,&lt;/P&gt;&lt;P&gt;Thierry&lt;/P&gt;</description>
      <pubDate>Fri, 11 Apr 2025 08:58:42 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/extremecloud-iq/problem-with-api-token-and-xiq/m-p/118477#M4590</guid>
      <dc:creator>Thilroy</dc:creator>
      <dc:date>2025-04-11T08:58:42Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with API Token and XIQ</title>
      <link>https://community.extremenetworks.com/t5/extremecloud-iq/problem-with-api-token-and-xiq/m-p/118478#M4591</link>
      <description>&lt;P&gt;Update : I finally managed to make it work, I think I had a mistype in my script.&lt;/P&gt;&lt;P&gt;Now I only have a {"error_code":"BAD_REQUEST","error_id":"bf26a56d1c4846bfa8bb1d8195b20359"} to investigate. I guess that my create group data isn't right.&lt;/P&gt;&lt;P&gt;T.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Apr 2025 10:09:46 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/extremecloud-iq/problem-with-api-token-and-xiq/m-p/118478#M4591</guid>
      <dc:creator>Thilroy</dc:creator>
      <dc:date>2025-04-11T10:09:46Z</dc:date>
    </item>
  </channel>
</rss>

