openapi on 6.2 fails to get clients

openapi on 6.2 fails to get clients

openapi on 6.2 fails to get clients
openapi on 6.2 fails to get clients
Yesterday
Hardware Version:
Firmware Version: 6.2.x

Dear Support,

 

I'm using client credentials grant login which works fine.

 

write-host '#devices'

$reqDevices = Invoke-RestMethod -SkipCertificateCheck -SkipHeaderValidation -Uri "$OMADA_URL/openapi/v1/$omadaCid/sites/$SITE_ID/devices?page=1&pageSize=100" -Method Get -Headers $RequestHeaders #-WebSession $OmadaSession

 

#devices

$reqDevices.result.data | ft

 

this works perfectly

 

BUT:

write-host '#clients'

$reqClients = Invoke-RestMethod -SkipCertificateCheck -SkipHeaderValidation -Uri "$OMADA_URL/openapi/v2/$omadaCid/sites/$SITE_ID/clients?page=1&pageSize=100" -Method Get -Headers $RequestHeaders #-WebSession $OmadaSession

#clients

$reqClients.result.data | select name,mac | write-host

 

gives an error:

 

Invoke-RestMethod: /Volumes/Media/python/omada/omada-openapi.ps1:89:15                                                  
Line |
  89 |  … eqClients = Invoke-RestMethod -SkipCertificateCheck -SkipHeaderValida …
     |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     |  {   "timestamp": 1776723123082,   "status": 405,   "error": "Method Not Allowed",   "path": "/openapi/v2/38ce6a8f70770e7cfac68966....../sites/69e0a50642803......./clients" } (I shortened the omada id and site id)

 

with this I can no longer retrieve any clients. This was the case though all beta/early releases of 6.2 SW controller.

 

btw: this also applies for. /api/v2 using "${OMADA_URL}/${CONTROLLER_ID}/api/v2/sites/${SITE_ID}/clients?currentPage=1&currentPageSize=100"  also general error

  0      
  0      
#1
Options
3 Reply
Re:openapi on 6.2 fails to get clients
23 hours ago

Hi @JayinNZ 

Thanks for reaching out to TP-Link Business Forums.

 

Thank you for sharing your observation to the forums.

Based on the error message, you are advised to correct the API command. 

Revise the "v2" to "v1" then it should work.

You can also refer to this Omada Open API

 

Hope this may help.

  0  
  0  
#2
Options
Re:openapi on 6.2 fails to get clients
8 hours ago - last edited 7 hours ago

  @Gabriel-TP 

Thank you for the quick answer. I get general error using openapi/v1 (or with /openapi/v2), also using /api/v2.

 

None of the current tools on the internet, like pyhton omada-client on pyorg or omada-dns (git gub: dougbw / coredns_omada Public) work with 6.2 (all fine with 6.1)

 

kind regards

Jay

  0  
  0  
#3
Options
Re:openapi on 6.2 fails to get clients
4 hours ago

Hi @JayinNZ 

 

Please note the differences: V2 uses POST, V1 uses GET, and in V2, the page and pageSize are not in the URL path but included in the body.

V1:

V2:

You can refer to this Omada Open API.

  0  
  0  
#4
Options