Web API Not returning any results.

Web API Not returning any results.

Web API Not returning any results.
Web API Not returning any results.
a week ago - last edited Monday
Hardware Version: V5
Firmware Version: 5.15.24.19

Hi,

 

Would really appreciate if someone who understand the controller API better than I could offer some insight, from everything I have read this should work, but no matter what I try I get an empty response.

 

I do this to get a token and cookie:


/usr/bin/curl -sk --connect-timeout 10 -c ./omada_cookie.txt -X POST https://192.168.60.146:443/api/v2/login -H 'Content-Type: application/json' -d '{"username": "apiuser", "password": "apiuser99"}'

 

It returns successfully and the two files are populated (script populates a file with the token that is read for the next step)

 

{"errorCode":0,"msg":"Log in successfully.","result":{"omadacId":"f5f6c0bbbd3556474933e0b3a9f9e0e1","token":"SECRET_TOKEN_RESPONSE"}}

 

Then I try to use those two files to interrogate further, but I always get an empty response, can anyone see what I am doing wrong, I have spent waaaay to long on this! :)

 

/usr/bin/curl -sk --connect-timeout 10 -b ./omada_cookie.txt -H 'Authorization: Bearer SECRET_TOKEN_RESPONSE' -H 'Content-Type: application/json' https://192.168.60.146:443/api/v2/sites

 

Nothing is returned, not even an error.

 

Stuck!

 

 

 

 

  0      
  0      
#1
Options
1 Accepted Solution
Re:Web API Not returning any results.-Solution
a week ago - last edited Monday

  @Sc0th I belive the API is "V1" not "V2". Per the API docs 

2.2.3 Access API Interface

After obtaining access token, it will be used to access API interfaces.

  • In the Header, fill in the access token. Note prefix of the access token in the Authorization header is "AccessToken=" .

Other parameters can be filled in according to the description in the online document

An example of the curl command of the get site list interface is as follows:
Request:

curl "https://localhost:8043/openapi/v1/de382a0e78f4deb681f3128c3e75dbd1/sites?pageSize=1&page=1" -H 'content-type:application/json' -H 'Authorization:AccessToken=AT-RCio7FS9p46wSD7dM8CwNQA7ylcrmAcV' -X GET -i -k --insecure

Response:

Recommended Solution
  0  
  0  
#2
Options
1 Reply
Re:Web API Not returning any results.-Solution
a week ago - last edited Monday

  @Sc0th I belive the API is "V1" not "V2". Per the API docs 

2.2.3 Access API Interface

After obtaining access token, it will be used to access API interfaces.

  • In the Header, fill in the access token. Note prefix of the access token in the Authorization header is "AccessToken=" .

Other parameters can be filled in according to the description in the online document

An example of the curl command of the get site list interface is as follows:
Request:

curl "https://localhost:8043/openapi/v1/de382a0e78f4deb681f3128c3e75dbd1/sites?pageSize=1&page=1" -H 'content-type:application/json' -H 'Authorization:AccessToken=AT-RCio7FS9p46wSD7dM8CwNQA7ylcrmAcV' -X GET -i -k --insecure

Response:

Recommended Solution
  0  
  0  
#2
Options