Create Voucher via Open API Not Working "Path not found" ERROR - Omada SDN Controller Open API v1

Create Voucher via Open API Not Working "Path not found" ERROR - Omada SDN Controller Open API v1

Create Voucher via Open API Not Working "Path not found" ERROR - Omada SDN Controller Open API v1
Create Voucher via Open API Not Working "Path not found" ERROR - Omada SDN Controller Open API v1
Monday - last edited Friday
Tags: #Controller #API #Create Voucher API v1

Hi,

I have this weird issue that when I tried testing the https://use1-omada-northbound.tplinkcloud.com/doc.html#/00%20All/Voucher/createVoucherGroup

/openapi/v1/{omadacId}/sites/{siteId}/hotspot/voucher-groups 


 

Controller Version: 5.14.32.3



It will just return this response "Not Found" and this is only affect the Voucher endpoint.

{"timestamp":1736160844088,"status":404,"error":"Not Found","path":"/openapi/v1/{omadacID}/sites/siteID/hotspot/voucher-groups"}

Permissions are all set as well.


 



And here's my complete PHP test code.

------------------------------------------------------------------

<?php

 

// Define the common variables

$server_ip = "{removed}";

$omadac_id = "{removed}";

$site_id = "{removed}";

$access_token = "AT-js2IYJDT12AVhRknqImSS6KnGNJ9UnMh";

 

// Construct the URL

$url = "https://{$server_ip}:8043/openapi/v1/{$omadac_id}/sites/{$site_id}/hotspot/voucher-groups";

 

// Initialize cURL

$ch = curl_init($url);

 

// Set cURL options

curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

curl_setopt($ch, CURLOPT_POST, true);

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // Only for testing; remove for production

curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); // Only for testing; remove for production

curl_setopt($ch, CURLOPT_HTTPHEADER, [

'Content-Type: application/json',

"Authorization: AccessToken={$access_token}"

]);

 

// Add your POST data here

$voucher_data = [

"name" => "API Generated Voucher",

"amount" => 5,

"codeLength" => 6,

"codeForm" => [0, 1],

"limitType" => 0,

"limitNum" => 1,

"durationType" => 1,

"duration" => 60,

"timingType" => 1,

"rateLimit" => [

"mode" => 0,

"rateLimitProfileId" => "",

"customRateLimit" => [

"downLimitEnable" => true,

"downLimit" => 3024,

"upLimitEnable" => true,

"upLimit" => 3024

]

],

"trafficLimitEnable" => true,

"trafficLimit" => 1024,

"trafficLimitFrequency" => 0,

"unitPrice" => 1,

"currency" => "PHP",

"applyToAllPortals" => true,

"portals" => [],

"expirationTime" => 0,

"effectiveTime" => 0,

"logout" => true,

"description" => "demo from the API",

"printComments" => ""

];

 

$post_data = [

"createVoucherGroupOpenApiVO" => $voucher_data

];

 

// Set the POST data

curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($post_data));

 

// Execute the request

$response = curl_exec($ch);

 

// Check for errors

if (curl_errno($ch)) {

echo 'Curl error: ' . curl_error($ch);

} else {

$http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);

if ($http_code === 200) {

echo "Success: " . $response;

} else {

echo "Error: HTTP Status Code {$http_code}\n";

echo "Response: " . $response;

}

}

 

// Close cURL session

curl_close($ch);

?>



------------------------------------------------------------------


I hope from TP-link Developer team can check this.

Thank you

  0      
  0      
#1
Options
2 Accepted Solutions
Re:Create Voucher via Open API Not Working "Path not found" ERROR - Omada SDN Controller Open API v1-Solution
Friday - last edited Friday

  @xkai 

@mnoquiao 

 

This is because you were referring to the API documents for the cloud-based controller. And the software controller doesn't have that interface.

 

Please make sure you were checking the correct API document for your controller type. 

Wish you a happy life and smooth network usage! 
Recommended Solution
  0  
  0  
#11
Options
Re:Create Voucher via Open API Not Working "Path not found" ERROR - Omada SDN Controller Open API v1-Solution
Friday - last edited Friday

Okay, I was able to get around and create a "vouchers" but the endpoint using the API v2 is this /voucherGroups
 

You need to include the Omada ID and Site ID as well. 

Recommended Solution
  0  
  0  
#15
Options
18 Reply
Re:Create Voucher via Open API Not Working - Omada SDN Controller
Tuesday

Hi  @xkai 

 

Before that, please make sure you have checked the API document on this page:

Wish you a happy life and smooth network usage! 
  0  
  0  
#2
Options
Re:Create Voucher via Open API Not Working - Omada SDN Controller
Tuesday

  @Vincent-TP Yes I already opened and followed it and the only endpoint that is not working is the /vouchers the rest I can't access and it works.

These endpoints will return "url not found".



Error: HTTP Status Code 404
Response: {"timestamp":1736233407438,"status":404,"error":"Not Found","path":"/openapi/v1/260b860c3d56c7dacb5be46191daf694/sites/677969fdf90d7733d84b4a21/hotspot/voucher-groups"}%  

The rest no issues so far.

Thank you.

  0  
  0  
#3
Options
Re:Create Voucher via Open API Not Working - Omada SDN Controller
Tuesday

My POST request also has an "Authentication Token" but this is the only endpoint that is not working.


 

  0  
  0  
#4
Options
Re:Create Voucher via Open API Not Working "Path not found" ERROR - Omada SDN Controller Open API v1
Tuesday

  @xkai 

 

I am experiencing the same issue, hope somebody from the DevTeam can give us solution on the matter.

 

  0  
  0  
#6
Options
Re:Create Voucher via Open API Not Working "Path not found" ERROR - Omada SDN Controller Open API v1
Wednesday
Hopefully they will investigate and check this bug because I really need this functionality. And thanks for testing and confirming this bug mate.
  0  
  0  
#7
Options
Re:Create Voucher via Open API Not Working "Path not found" ERROR - Omada SDN Controller Open API v1
Wednesday

@Vincent-TP Hi, have you checked this bug 2 devs have already encountered this bug. 

Thank you so much!

  0  
  0  
#8
Options
Re:Create Voucher via Open API Not Working "Path not found" ERROR - Omada SDN Controller Open API v1
Wednesday

  @xkai 

@mnoquiao

 

We are checking. Will update here if any progress.

Wish you a happy life and smooth network usage! 
  0  
  0  
#9
Options
Re:Create Voucher via Open API Not Working "Path not found" ERROR - Omada SDN Controller Open API v1
Wednesday

 

Vincent-TP wrote

  @xkai 

@mnoquiao

 

We are checking. Will update here if any progress.


Thank you so much for chekcing.

  0  
  0  
#10
Options
Re:Create Voucher via Open API Not Working "Path not found" ERROR - Omada SDN Controller Open API v1-Solution
Friday - last edited Friday

  @xkai 

@mnoquiao 

 

This is because you were referring to the API documents for the cloud-based controller. And the software controller doesn't have that interface.

 

Please make sure you were checking the correct API document for your controller type. 

Wish you a happy life and smooth network usage! 
Recommended Solution
  0  
  0  
#11
Options
Re:Create Voucher via Open API Not Working "Path not found" ERROR - Omada SDN Controller Open API v1
Friday - last edited Friday

  @Vincent-TP I got it, when can we expect the release of the "Voucher" API endpoint on OMADA SDN Controller?

Can you help me or point me to a doc or guide that I can use to generate a voucher because the Opean API doesn't support it right now?

Thank you

  0  
  0  
#12
Options