Get all "Vouchers" Created via Omada Controller via API
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!
- Copy Link
- Subscribe
- Bookmark
- Report Inappropriate Content
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¤tPageSize=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!
- Copy Link
- Report Inappropriate Content
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¤tPageSize=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!
- Copy Link
- Report Inappropriate Content
Hi @Hank21 will this run when I only have "remote access" to the physical omada controller?
Thank you!
- Copy Link
- Report Inappropriate Content
@Hank21 I tried it and I got nothing in "network" tab, please take a look the screenshot.
Thank you!
- Copy Link
- Report Inappropriate Content
@Hank21 I think I got it working.
- Copy Link
- Report Inappropriate Content
Information
Helpful: 0
Views: 2657
Replies: 4
Voters 0
No one has voted for it yet.