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
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
- Copy Link
- Subscribe
- Bookmark
- Report Inappropriate Content
that's what I suspect the problem is in the API Docs it's not clearly written if the endpoint is for "Cloud", "Software" or "Hardware" controller it would be awesome if someone can add that small details in the official documentation: https://use1-omada-northbound.tplinkcloud.com/doc.html#/home
Thanks!
- Copy Link
- Report Inappropriate Content
mnoquiao wrote
that's what I suspect the problem is in the API Docs it's not written if the endpoint is for a "Cloud", "Software" or "Hardware" controller it would be awesome if someone could add that small details in the official documentation: https://use1-omada-northbound.tplinkcloud.com/doc.html#/home
Thanks!
@mnoquiao Yeah, now it's clear that it's a documentation error and they don't have any guide as well on how to use the Web API v2.
- Copy Link
- Report Inappropriate Content
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.
- Copy Link
- Report Inappropriate Content
@xkai
Care to share the actual endpoint you've use or the link to documentation? Thanks in Advance!
- Copy Link
- Report Inappropriate Content
Hi @xkai
We will add this feature at Omada SDN software controller v5.15.20.
And the pre-release version will be released soon. Please stay tuned.
- Copy Link
- Report Inappropriate Content
Vincent-TP wrote
Hi @xkai
We will add this feature at Omada SDN software controller v5.15.20.
And the pre-release version will be released soon. Please stay tuned.
I think we will just wait for this version.
Thank you!
- Copy Link
- Report Inappropriate Content
Hi @xkai
I just post it: we only have windows verison for now.
Omada SDN Controller_V5.15.20.7 Pre-Release Firmware Windows
- Copy Link
- Report Inappropriate Content
- Copy Link
- Report Inappropriate Content
Information
Helpful: 0
Views: 292
Replies: 18
Voters 0
No one has voted for it yet.