Authentication overview

PrexView utilizes a straightforward authentication model designed to integrate efficiently with applications requiring automated document generation. Access to the PrexView API is secured through API keys, which function as bearer tokens. This method ensures that all requests made to the API are authenticated to prevent unauthorized access to document creation, management, and retrieval functionalities. The API keys are generated within the user's PrexView account dashboard and must be included in the header of every API request.

The system is built on a RESTful architecture, allowing for standard HTTP methods (GET, POST, PUT, DELETE) and responses typically formatted in JSON. This design choice aims to provide a familiar and accessible integration experience for developers across various programming environments. PrexView also offers client libraries in Python, Node.js, PHP, Java, and Ruby, which abstract the underlying HTTP request details, including the secure handling of API keys.

Supported authentication methods

PrexView primarily supports API key authentication. This method is common for RESTful APIs and provides a balance of security and ease of use for server-to-server communication or backend applications. While API keys are the main mechanism, the underlying principles align with secure token-based authentication practices.

The following table outlines the authentication method supported by PrexView, detailing its application and general security level:

Method When to Use Security Level
API Key (Bearer Token) Server-to-server communication, backend applications, system integrations where the key can be securely stored. Moderate to High (when managed securely and transmitted over HTTPS).

For additional layers of security, developers may implement strategies such as IP whitelisting or request signing on their integration side, although these are not explicitly mandated by PrexView's core authentication mechanism. The API key itself serves as the primary credential for authorization.

Getting your credentials

To authenticate with the PrexView API, you need to obtain an API key from your PrexView account. The process typically involves logging into your dashboard and navigating to the API settings or developer section. These keys are unique to your account and should be treated with the same confidentiality as passwords.

  1. Sign Up/Log In: Navigate to the PrexView website and either sign up for a new account or log in to an existing one. PrexView offers a Free Plan for initial testing and development.
  2. Access Dashboard: Once logged in, access your user dashboard.
  3. Locate API Settings: Look for a section labeled 'API Settings', 'Developers', or 'Integrations'. The exact path may vary but is usually intuitive.
  4. Generate API Key: Within the API settings, you will find an option to generate a new API key. Some platforms allow for multiple keys, which can be useful for different environments (e.g., development, staging, production) or different applications.
  5. Copy Key: Once generated, copy the API key immediately. For security reasons, keys are often shown only once upon generation and cannot be retrieved later. If lost, a new key must be generated.
  6. Store Securely: Store your API key in a secure location, such as environment variables, a secrets manager, or a secure configuration file. Avoid hardcoding keys directly into your source code.

PrexView's API reference documentation provides specific instructions and examples for accessing and managing your credentials within their platform.

Authenticated request example

Authenticated requests to the PrexView API involve including your API key in the Authorization header of your HTTP request. The API key should be prefixed with Bearer, forming a Bearer Token. This is a standard practice for token-based authentication, as documented by RFC 6750 for OAuth 2.0 Bearer Token Usage.

Here's an example of how to make an authenticated request using curl, demonstrating a POST request to create a document:

curl -X POST \  https://api.prexview.com/v1/documents \  -H "Authorization: Bearer YOUR_API_KEY" \  -H "Content-Type: application/json" \  -d '{"template_id": "tpl_12345", "data": {"name": "John Doe", "amount": 150.00}}'

In this example:

  • YOUR_API_KEY should be replaced with the actual API key obtained from your PrexView dashboard.
  • The -H "Authorization: Bearer YOUR_API_KEY" header is where the authentication credential is provided.
  • The -H "Content-Type: application/json" header specifies the format of the request body.
  • The -d flag is used to send the JSON payload containing the data for document generation.

When using one of the PrexView SDKs (Python, Node.js, PHP, Java, Ruby), the client library typically handles the inclusion of the API key in the request headers automatically after you initialize the client with your key. This simplifies the integration process and reduces the chance of errors in handling authentication headers.

Security best practices

Securing your PrexView API key and integration is crucial to prevent unauthorized document generation or access to your templates and data. Adhering to established security best practices for API keys helps maintain the integrity and confidentiality of your operations.

  • Keep API Keys Confidential: Treat your API keys like passwords. Never hardcode them directly into your application's source code. Instead, use environment variables, a secrets management service (e.g., AWS Secrets Manager, Google Secret Manager), or a secure configuration file that is not committed to version control.
  • Use HTTPS/TLS: Always ensure that all communication with the PrexView API occurs over HTTPS (TLS). This encrypts the data in transit, protecting your API key and sensitive document data from interception by malicious actors. PrexView's API endpoints are designed to enforce HTTPS, but it's good practice to confirm your client is configured accordingly.
  • Implement Least Privilege: If PrexView were to introduce role-based access for API keys in the future, generate keys with the minimum necessary permissions required for your application to function. This limits the potential damage if a key is compromised.
  • Rotate API Keys Regularly: Periodically rotate your API keys. This practice minimizes the window of opportunity for a compromised key to be exploited. Establish a schedule for key rotation, especially after personnel changes or security incidents.
  • Monitor API Usage: Regularly monitor your API usage logs for any unusual activity or spikes in requests. This can help detect unauthorized access or abuse of your API key. Set up alerts for suspicious patterns.
  • Implement IP Whitelisting (if available/applicable): If your infrastructure allows, restrict API key usage to a specific set of trusted IP addresses. While PrexView's documentation does not explicitly mention IP whitelisting as a native feature for API keys, many cloud providers and API gateways offer this capability as an additional layer of security for outbound requests.
  • Error Handling and Logging: Implement robust error handling for API authentication failures. Log these failures for auditing and troubleshooting, but be careful not to log the API key itself.
  • Secure Development Lifecycle: Integrate security considerations throughout your development lifecycle. Conduct code reviews, security testing, and vulnerability assessments to identify and address potential weaknesses in your integration with PrexView.

By following these best practices, developers can significantly enhance the security posture of their PrexView integrations, protecting both their data and their users.