<?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 API Request to the external VIQ/VHM list in Cloud Based Network Management</title>
    <link>https://community.extremenetworks.com/t5/cloud-based-network-management/api-request-to-the-external-viq-vhm-list/m-p/119311#M54</link>
    <description>&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;I am trying to get a device list using the XIQ API which works fine but is only running it against my Home network.&lt;BR /&gt;&lt;BR /&gt;I am using the below to get device list:&lt;BR /&gt;&lt;SPAN&gt;&lt;A href="https://api.extremecloudiq.com/devices?page=1" target="_blank"&gt;https://api.extremecloudiq.com/devices?page=1&lt;/A&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;What I require though is to be able to run this against the External sites that appear on this API:&lt;BR /&gt;&lt;SPAN&gt;&lt;A href="https://api.extremecloudiq.com/account/external" target="_blank"&gt;https://api.extremecloudiq.com/account/external&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;I tried to find the VIQ but again only shows my Home account and not the external ones.&lt;BR /&gt;&lt;BR /&gt;Any advice on this please ?&lt;/P&gt;</description>
    <pubDate>Wed, 16 Jul 2025 15:51:44 GMT</pubDate>
    <dc:creator>uk-oldman</dc:creator>
    <dc:date>2025-07-16T15:51:44Z</dc:date>
    <item>
      <title>API Request to the external VIQ/VHM list</title>
      <link>https://community.extremenetworks.com/t5/cloud-based-network-management/api-request-to-the-external-viq-vhm-list/m-p/119311#M54</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;I am trying to get a device list using the XIQ API which works fine but is only running it against my Home network.&lt;BR /&gt;&lt;BR /&gt;I am using the below to get device list:&lt;BR /&gt;&lt;SPAN&gt;&lt;A href="https://api.extremecloudiq.com/devices?page=1" target="_blank"&gt;https://api.extremecloudiq.com/devices?page=1&lt;/A&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;What I require though is to be able to run this against the External sites that appear on this API:&lt;BR /&gt;&lt;SPAN&gt;&lt;A href="https://api.extremecloudiq.com/account/external" target="_blank"&gt;https://api.extremecloudiq.com/account/external&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;I tried to find the VIQ but again only shows my Home account and not the external ones.&lt;BR /&gt;&lt;BR /&gt;Any advice on this please ?&lt;/P&gt;</description>
      <pubDate>Wed, 16 Jul 2025 15:51:44 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/cloud-based-network-management/api-request-to-the-external-viq-vhm-list/m-p/119311#M54</guid>
      <dc:creator>uk-oldman</dc:creator>
      <dc:date>2025-07-16T15:51:44Z</dc:date>
    </item>
    <item>
      <title>Re: API Request to the external VIQ/VHM list</title>
      <link>https://community.extremenetworks.com/t5/cloud-based-network-management/api-request-to-the-external-viq-vhm-list/m-p/120383#M55</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Here is example for Python . First, you will need to get a list of accounts that have been granted external access. The /account/external endpoint will be used for this.&amp;nbsp;&lt;A href="https://api.extremecloudiq.com/swagger-ui/index.html#/Account/listExternalAccounts" target="_blank" rel="noopener"&gt;https://api.extremecloudiq.com/swagger-ui/index.html#/Account/listExternalAccounts&lt;/A&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Create a new&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;url&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;variable and concatenate the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;baseurl&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;with&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;/account/external&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;I&gt;url = baseurl + '/account/external’&lt;/I&gt;&lt;/P&gt;&lt;P&gt;This will override the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;url&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;variable with the new URL. This is fine for our purpose. Next, we will build a new GET request and assign the response object to the response variable. This also overrides the response variable.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;I&gt;response = requests.get(url,headers=headers)&lt;/I&gt;&lt;/P&gt;&lt;P&gt;Next, print the JSON data from the response.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;I&gt;print(response.json()) .&amp;nbsp;&lt;/I&gt;&lt;/P&gt;&lt;P&gt;With the ID of the VIQ you want to switch to, you can use the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;/account/:switch?id={{viq_id}}&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;endpoint. Using the same process, we will create the URL, perform the POST call, and then update the header authorization with the new token.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;I&gt;url = baseurl + ‘/account/:switch?id={{viq_id}}&lt;/I&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;replace {{viq_id}} with the id returned for the VIQ&lt;/P&gt;&lt;P&gt;&lt;I&gt;response = requests.post(url,headers=headers)&lt;/I&gt;&lt;/P&gt;&lt;P&gt;&lt;I&gt;data = response.json()&lt;/I&gt;&lt;/P&gt;&lt;P&gt;&lt;I&gt;headers[‘Authorization’] = ‘Bearer ‘ + data[‘access_token’]&amp;nbsp; . Here is a code example :&amp;nbsp;&lt;/I&gt;&lt;/P&gt;&lt;PRE&gt;import requests
import json
baseurl = "https://api.extremecloudiq.com"

headers = {'Accept': 'application/json', 'Content-Type': 'application/json'}
body = {
    "username": "your_user_name@example.com", 
    "password": "your_password"  
}


# Login URL
url = baseurl + '/login'
# Login Request
response = requests.post(url, headers=headers, json=body)


# Check if login was successful
if response.status_code != 200:
    print(f"Error getting access token - HTTP Status Code: {str(response.status_code)}")
    exit()


# Extract token from response
data = response.json()
token = data.get('access_token')
if not token:
    print("Error: No access token found in the response")
    exit()


# Update headers with the Authorization token
headers['Authorization'] = 'Bearer ' + token


# GET request to /account/external
url = baseurl + '/account/external'
response = requests.get(url, headers=headers)
if response.status_code == 200:
    external_data = response.json()
    print("External Account Data:")
    print(json.dumps(external_data, indent=4))
else:
    print(f"Error fetching external account data - HTTP Status Code: {response.status_code}")

# GET request to /account/:switch?id={VIQ_ID} 

url = f"{baseurl}/account/:switch?id=398641"  #Replace VIQ ID as needed
response = requests.post(url, headers=headers)
if response.status_code == 200:
    switch_data = response.json()
    print("Switch Data:")
    print(json.dumps(switch_data, indent=4))
else:
    print(f"Error fetching switch data - HTTP Status Code: {response.status_code}")
headers['Authorization'] = 'Bearer ' + data['access_token']


# Print headers for verification
print("Headers with Authorization token:")
print(headers)


&lt;/PRE&gt;</description>
      <pubDate>Mon, 29 Sep 2025 23:50:03 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/cloud-based-network-management/api-request-to-the-external-viq-vhm-list/m-p/120383#M55</guid>
      <dc:creator>Ostrovsky__Yury</dc:creator>
      <dc:date>2025-09-29T23:50:03Z</dc:date>
    </item>
  </channel>
</rss>

