Prerequisites
Before using this prompt, you need:
- An Autheona account: Sign up at https://app.autheona.com/sign-up
- A project (Sandbox or Production): See project creation guide
- An access token with API permissions: See access token documentation
Store your access token securely using environment variables. Never hardcode tokens in your source code.
Ready-to-Use Prompt
Copy the entire code block below and paste it into Qwen:
I need to integrate the Autheona User Trust API for email validation into my application.
First, fetch the complete API specification from this URL: https://autheona.com/docs/api-reference/user-trust/
The API endpoint is POST https://api.autheona.com/v1/intelligence
AUTHENTICATION: Include header "x-api-key" with my access token value.
REQUIRED REQUEST BODY:
{
"email_address": "string"
}
Based on the fetched API documentation, implement the following:
IMPLEMENTATION REQUIREMENTS:
1. SECURE CONFIGURATION:
- Read API access token from environment variable (AUTHEONA_API_KEY)
- Never log or expose the access token
- Validate that AUTHEONA_API_KEY is set before making requests
2. API CLIENT IMPLEMENTATION:
- Create a reusable function/method to call the API
- Set timeout of 5 seconds for API requests
- Handle network errors gracefully
- Implement retry logic with exponential backoff (max 3 retries)
- Use HTTPS only
3. ERROR HANDLING:
- Handle HTTP 401 (invalid API key) by logging authentication error
- Handle HTTP 400 (invalid request) by logging validation error
- Handle HTTP 500 (server error) with fallback behavior
- Handle network timeouts with graceful degradation
- Return appropriate error messages without exposing sensitive data
4. RESPONSE PROCESSING:
- Parse JSON response safely
- Extract the "action" field for decision making (allow/block/ignore) if available
5. INTEGRATION POINTS:
- Provide a function to validate email at user registration
- Provide a function to validate email at login
6. SECURITY BEST PRACTICES:
- Sanitize email input (trim whitespace, lowercase)
- Never cache responses containing sensitive data
- Rate limit calls to 10 requests per second per token
- Implement request ID for tracing
- Follow the same coding pattern and design style used in the user's code
- Do not implement anything you do not have a clear understanding of. Always verify before writing
- If you have any questions, ask and clarify first
Write the complete implementation code for me.
Additional context about my use case:
[DESCRIBE YOUR USE CASE HERE]How to Use This Prompt
- Copy the entire prompt code block above
- Paste it into a new Qwen conversation
- Replace
[DESCRIBE YOUR USE CASE HERE]with your specific requirements - Specify your preferred programming language if not Python
- Qwen will fetch the API specification and generate the complete implementation
What Qwen Will Implement
Qwen will generate code that includes:
- Secure API client with authentication handling
- Input validation and sanitization
- Comprehensive error handling
- Retry logic with exponential backoff
- Response parsing and decision logic
- Environment-based configuration
- Integration examples for registration and login flows
Post-Implementation Steps
After Qwen provides the implementation:
- Review the generated code for your specific needs
- Test in your Sandbox project first
- Add the
AUTHEONA_API_KEYenvironment variable to your deployment - Monitor API usage in the Autheona dashboard
- Adjust your policy rules in the Policy Editor as needed
Support
For issues with the API, refer to: