Files
omada-api/NOTES.md

47 lines
1.7 KiB
Markdown
Raw Normal View History

# Implementation Notes
## API Endpoint Compatibility
This library is built based on the Omada Controller REST API specification. However, the actual API endpoints may vary slightly between Omada Controller versions. The following adjustments may be needed:
### Authentication Endpoint
The authentication endpoint used is `/api/v2/login`. If your Omada Controller uses a different endpoint, you may need to adjust the `Authentication.ts` file.
Common alternatives:
- `/api/v2/oauth/token` (OAuth2 token endpoint)
- `/api/v1/login` (v1 API)
### API Path Structure
The library assumes the API follows REST conventions:
- `/sites/{siteId}/devices/{deviceId}`
- `/sites/{siteId}/vlans/{vlanId}`
- etc.
If your Omada Controller uses a different path structure, you may need to adjust the service classes accordingly.
## SSL Certificate Handling
The library supports self-signed certificates by setting `verifySSL: false`. However, when using native `fetch` in Node.js 18+, SSL certificate handling may work differently than with `node-fetch`.
If you encounter SSL certificate issues:
1. **Option 1**: Use `node-fetch` package instead of native fetch
2. **Option 2**: Set `NODE_TLS_REJECT_UNAUTHORIZED=0` environment variable (development only)
3. **Option 3**: Install proper SSL certificates on the Omada Controller
## Testing with Actual Omada Controller
Before using in production, test with your actual Omada Controller to verify:
1. Authentication endpoint and request format
2. API response structure
3. Error code meanings
4. Required vs optional parameters
## Contributing Improvements
If you discover API endpoint differences or need additional features, please update the service classes accordingly.