Integrate Autheona using GLM

This guide provides a ready-to-use prompt for GLM AI to implement the Autheona User Trust API in your application. Copy the prompt below and paste it into GLM, and provide your specific requirements.

Prerequisites

Before using this prompt, you need:

  1. An Autheona account: Sign up at https://app.autheona.com/sign-up
  2. A project (Sandbox or Production): See project creation guide
  3. 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 GLM:

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

  1. Copy the entire prompt code block above
  2. Paste it into a new GLM conversation
  3. Replace [DESCRIBE YOUR USE CASE HERE] with your specific requirements
  4. Specify your preferred programming language if not Python
  5. GLM will fetch the API specification and generate the complete implementation

What GLM Will Implement

GLM will generate code that includes:

Post-Implementation Steps

After GLM provides the implementation:

  1. Review the generated code for your specific needs
  2. Test in your Sandbox project first
  3. Add the AUTHEONA_API_KEY environment variable to your deployment
  4. Monitor API usage in the Autheona dashboard
  5. Adjust your policy rules in the Policy Editor as needed

Support

For issues with the API, refer to: