Get all "Vouchers" Created via Omada Controller via API

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

Get all "Vouchers" Created via Omada Controller via API

This thread has been locked for further replies. You can start a new thread to share your ideas or ask questions.
Get all "Vouchers" Created via Omada Controller via API
Get all "Vouchers" Created via Omada Controller via API
2022-10-13 14:26:46 - last edited 2022-10-18 06:48:38

Hi, 

I know there's a "Omada Controller" SDK / API already but may I ask if anyone tried

getting all the "vouchers" generated via the "Omada Controller" using the API in PHP or cURL?

Thank you!

  0      
  0      
#1
Options
1 Accepted Solution
Re:Get all "Vouchers" Created via Omada Controller via API-Solution
2022-10-14 09:21:58 - last edited 2022-10-18 06:48:28

Dear @xkai

 

xkai wrote

I know there's a "Omada Controller" SDK / API already but may I ask if anyone tried

getting all the "vouchers" generated via the "Omada Controller" using the API in PHP or cURL?

 

You can use the F12 network tool of the browser to monitor the HTTPS requests, when you check the vouchers, you will see the API calling process, right click it then you can copy it as curl.

 

curl 'https://localhost:8043/CONTROLLER_ID/api/v2/hotspot/sites/63350cb28f5bfa4a21a3d50b/vouchers?currentPage=1&currentPageSize=10&status=All' \
  -H 'Accept: application/json, text/javascript, */*; q=0.01' \
  -H 'Connection: keep-alive' \
  -H 'Content-Type: application/json; charset=UTF-8' \
  -H 'Cookie: TPEAP_SESSIONID=COOKIE
  -H 'Csrf-Token: TOKEN' \
  -H 'Referer: https://localhost:8043/CONTROLLER_ID/login' \
  -H 'Sec-Fetch-Mode: cors' \
  -H 'Sec-Fetch-Site: same-origin' \
  -H 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36 Edg/106.0.1370.42' \
  -H 'X-Requested-With: XMLHttpRequest' \

 

Best Regards!

Best Regards! >> Omada EAP Firmware Trial Available Here << >> Get the Latest Omada SDN Controller Releases Here << *Try filtering posts on each forum by Label of [Early Access]*
Recommended Solution
  0  
  0  
#3
Options
4 Reply
Re:Get all "Vouchers" Created via Omada Controller via API-Solution
2022-10-14 09:21:58 - last edited 2022-10-18 06:48:28

Dear @xkai

 

xkai wrote

I know there's a "Omada Controller" SDK / API already but may I ask if anyone tried

getting all the "vouchers" generated via the "Omada Controller" using the API in PHP or cURL?

 

You can use the F12 network tool of the browser to monitor the HTTPS requests, when you check the vouchers, you will see the API calling process, right click it then you can copy it as curl.

 

curl 'https://localhost:8043/CONTROLLER_ID/api/v2/hotspot/sites/63350cb28f5bfa4a21a3d50b/vouchers?currentPage=1&currentPageSize=10&status=All' \
  -H 'Accept: application/json, text/javascript, */*; q=0.01' \
  -H 'Connection: keep-alive' \
  -H 'Content-Type: application/json; charset=UTF-8' \
  -H 'Cookie: TPEAP_SESSIONID=COOKIE
  -H 'Csrf-Token: TOKEN' \
  -H 'Referer: https://localhost:8043/CONTROLLER_ID/login' \
  -H 'Sec-Fetch-Mode: cors' \
  -H 'Sec-Fetch-Site: same-origin' \
  -H 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36 Edg/106.0.1370.42' \
  -H 'X-Requested-With: XMLHttpRequest' \

 

Best Regards!

Best Regards! >> Omada EAP Firmware Trial Available Here << >> Get the Latest Omada SDN Controller Releases Here << *Try filtering posts on each forum by Label of [Early Access]*
Recommended Solution
  0  
  0  
#3
Options
Re:Get all "Vouchers" Created via Omada Controller via API
2022-10-14 09:34:39 - last edited 2022-10-18 06:48:28

Hi @Hank21 will this run when I only have "remote access" to the physical omada controller?

Thank you!

  0  
  0  
#4
Options
Re:Get all "Vouchers" Created via Omada Controller via API
2022-10-14 09:38:54 - last edited 2022-10-18 06:48:28

  @Hank21 I tried it and I got nothing in "network" tab, please take a look the screenshot.

Thank you!

 

  0  
  0  
#5
Options
Re:Get all "Vouchers" Created via Omada Controller via API
2022-10-14 09:45:03 - last edited 2022-10-18 06:48:28

  @Hank21 I think I got it working.

  4  
  4  
#6
Options