OC300 Access with API and powershell

This thread has been locked for further replies. You can start a new thread to share your ideas or ask questions.

OC300 Access with API and powershell

This thread has been locked for further replies. You can start a new thread to share your ideas or ask questions.
OC300 Access with API and powershell
OC300 Access with API and powershell
2023-02-08 18:42:10
Tags: #API #Powershell
Model: OC300  
Hardware Version: V5
Firmware Version: 1.14.7 Build 20221206 Rel. 607706

Hello,

 

i would like to access the OC300 with a powershell 

 

Invoke-WebRequest -Method POST -Uri 'https://10.1.0.250:8043/{omadacId}/login' -Headers @{'Content-Type'='application/json'} -Body '{"username":"admin","password":"********"}' -UseBasicParsing

 

when i'm start this script i'm get the error "can't connect to the remoteserver"

 

Is there any switch in the OC300 configuration to switch on the API?

 

 

Regards

Stefan

 

  0      
  0      
#1
Options
6 Reply
Re:OC300 Access with API and powershell
2023-02-09 19:05:12

  @Stefan2023 

 

You missed a bit of the URI:

 

https://10.1.0.250:8043/{omadacId}/api/v2/login

 

Your JSON looks good to me.

<< Paying it forward, one juicy problem at a time... >>
  0  
  0  
#2
Options
Re:OC300 Access with API and powershell
2023-02-10 17:00:08

  @d0ugmac1 

 

Original German Error

"Invoke-WebRequest : Die Verbindung mit dem Remoteserver kann nicht hergestellt werden."

 

Translated 

"Invoke-WebRequest : Unable to connect to the remote server."

 

Is there any way to test if the connection works normally?

 

SSH Client or anything else?

 

 

  0  
  0  
#3
Options
Re:OC300 Access with API and powershell
2023-02-10 20:59:48

  @Stefan2023 

 

I'm sure it's all Microsoft's fault...  In the meantime have a look here:

 

https://github.com/ghaberek/omada-api

<< Paying it forward, one juicy problem at a time... >>
  0  
  0  
#4
Options
Re:OC300 Access with API and powershell
2023-02-11 13:55:54

  @d0ugmac1 

 

the python wrapper has the same error. 

 

the target machine don't allow the connection 

 

OC300 on IP 10.1.0.250

 

 

  0  
  0  
#5
Options
Re:OC300 Access with API and powershell
2023-02-11 14:20:04
https:10.1.0.250/api/info works https:10.1.0.250:8043/api/info Connection denied
  2  
  2  
#6
Options
Re:OC300 Access with API and powershell
2023-02-11 15:06:12 - last edited 2023-02-11 15:07:20

  @Stefan2023 

 

Wow, I so didn't see that coming...I was testing on my 5.8.4 software controller...

 

(from https://community.tp-link.com/en/business/forum/topic/559150)

 

 

 

<< Paying it forward, one juicy problem at a time... >>
  0  
  0  
#7
Options

Information

Helpful: 0

Views: 792

Replies: 6

Tags

API
Powershell
Related Articles