Hi @Lipton
Here are some possible reasons and solutions for the error code -41501 "Failed to authenticate" you're encountering when trying to authenticate a voucher code:
1. Check the Voucher Code
- **Validity**: Ensure that the voucher code you're using is valid and has not expired. You can check the validity of the voucher code in the Omada Controller's voucher management section.
- **Correctness**: Double-check that the voucher code is entered correctly in the request body. A small typo can lead to authentication failure.
2. Verify the Request Parameters
- **ClientMac**: Make sure the `clientMac` parameter matches the MAC address of the client device attempting to authenticate. It should be in the correct format (e.g., `00:11:22:33:44:55`).
- **apMac**: Confirm that the `apMac` parameter corresponds to the MAC address of the access point to which the client is connected.
- **ssidName**: Ensure that the `ssidName` parameter matches the name of the SSID the client is connected to.
- **site**: Verify that the `site` parameter is set to the correct site ID where the authentication is being attempted.
- **radioId**: Check that the `radioId` parameter is set to the correct radio ID (0 for 2.4G, 1 for 5G) of the band the client is connected to.
- **authType**: The `authType` parameter should be set to 3 for voucher code authentication.
3. Confirm the Login Credentials
- **Controller User**: If you're using the controller user for login, ensure that the username and password are correct and that the user has the necessary permissions to perform authentication operations.
- **Operator User**: Similarly, if you're using an operator user, verify the credentials and permissions.
4. Check the Omada Controller Configuration
- **External Portal Server Settings**: Ensure that the Omada Controller is correctly configured to use your external portal server. Check the settings in the Omada Controller's portal configuration section to make sure all the necessary details are correctly entered.
- **Voucher Code Settings**: Verify that the voucher code settings in the Omada Controller are configured to allow authentication via your external portal server.
5. Review the API Documentation
- The API documentation for the Omada Controller 5.0.15 or above can be found at [API and Code Sample for External Portal Server (Omada Controller 5.0.15 or above)](https://www.tp-link.com/us/support/faq/3231/). This document outlines the requirements and parameters for establishing an external portal server and provides code samples that you can refer to for guidance.
In the meantime, you may check the latest API documentation from this page: