Basic Open API question(s)

Basic Open API question(s)

Basic Open API question(s)
Basic Open API question(s)
2025-07-02 19:31:44 - last edited 2025-07-04 06:05:12
Model: OC300  
Hardware Version: V1
Firmware Version: 1.29.7 Build 20250514 Rel.59723

I am trying to use OpenAPI for the first time and run into a block -- I have created an openAPI client-mode application. 

First question: after creating it is there something I have to do to activate it (because, as you'll see in a minute, it is acting as if the applciation/cleint id dosn't exist)

 

I call /api/info and get a response with an omadicid

 

I then call {OMADA_HOST}/openapi/authorize/token?grant_type=client_credentials and I get a respnse that includes an access token, extracted below:

access token= AT-OiOguST7Ts6b4IIzuC5kPsVt49FpcfBP

 

Next I want to find a site id so I post to https://192.168.8.253/openapi/v2/sites with these headers and payload:

 

get_site_id headers: {'Authorization': 'Bearer AT-OiOguST7Ts6b4IIzuC5kPsVt49FpcfBP', 'Content-Type': 'application/json'}
get_site_id payload: {'omadacId': '748f2b5423aa3530b82f9312ad9535cc'}

 

And I get the following respoponse:

get_site_id status code: 200
get_site_id raw text: {"msg":"Controller ID not exist.","errorCode":-7131}

 

Any hint what stupid new user mistake I am making??

 

Thanks for any help!

  0      
  0      
#1
Options
1 Accepted Solution
Re:Basic Open API question(s)-Solution
2025-07-04 03:34:38 - last edited 2025-07-04 06:05:12

Hi  @PeteT 

 

Please refer to the following post to get the Omada ID for the OC300 and try again:

 

What is Controller/Omada ID and How to Get it?

 

 

Recommended Solution
  0  
  0  
#2
Options
3 Reply
Re:Basic Open API question(s)-Solution
2025-07-04 03:34:38 - last edited 2025-07-04 06:05:12

Hi  @PeteT 

 

Please refer to the following post to get the Omada ID for the OC300 and try again:

 

What is Controller/Omada ID and How to Get it?

 

 

Recommended Solution
  0  
  0  
#2
Options
Re:Basic Open API question(s)
2025-07-04 04:55:39

  @Vincent-TP Thanks.  I figured it out.  As someone noted, there is a link on the web page where you add the application that points to the API.  Spent about 15 minutes following the documentation and it worked perfectly (imagine that: if all else faoils read the instructions)

  0  
  0  
#3
Options
Re:Basic Open API question(s)
2025-07-04 06:05:44

Hi  @PeteT 

 

Great to hear that the issue has been resolved! If you encounter any further problems or have additional questions, feel free to reach out. We're here to help! 😊

  0  
  0  
#4
Options