Authentication overview
Vector Express v2.0 utilizes an authentication system designed to secure access to its vectorization APIs. This system ensures that only authorized applications and users can initiate requests for converting documents and images into vector formats like SVG and DXF. The primary method of authentication involves the use of API keys, which serve as unique identifiers and access tokens for your account. All API interactions are conducted over HTTPS/TLS to encrypt data in transit, protecting both your credentials and the content of your requests and responses.
The API authentication mechanism is integrated across all core products offered by Vector Express v2.0, including the PDF to SVG API, Image to DXF API, and the AI Vectorizer. Developers can integrate authentication into their applications using the provided SDKs for Node.js, Python, Go, and Ruby, or by directly including the API key in HTTP request headers for other environments. Adhering to security best practices, such as keeping API keys confidential and rotating them regularly, is critical for maintaining the security of your integrations.
Supported authentication methods
Vector Express v2.0 primarily supports API key authentication. This method is common for web services due to its simplicity and ease of implementation across various programming environments. API keys are long, randomly generated strings that are unique to your Vector Express account.
| Method | When to Use | Security Level |
|---|---|---|
| API Key | Server-side applications, backend services, script-based integrations where the key can be securely stored. | Moderate to High (when managed securely) |
When using API keys, the key is typically passed in a custom HTTP header (e.g., X-API-Key or Authorization: Bearer <API_KEY>) with each request. This method establishes the identity of the calling application and authorizes it against the permissions associated with the key. While API keys offer a straightforward authentication mechanism, they must be handled with care to prevent unauthorized access. Unlike token-based systems like OAuth 2.0, API keys do not typically expire automatically and require manual rotation for enhanced security. For a broader understanding of API authentication types, see the MDN Web Docs on HTTP authentication.
Getting your credentials
To authenticate with Vector Express v2.0, you need an API key associated with your account. Follow these steps to obtain your credentials:
- Sign Up or Log In: Navigate to the Vector Express homepage and either create a new account or log in to your existing one.
- Access Dashboard: Once logged in, proceed to your user dashboard. This is typically accessible via a link in the navigation menu, often labeled "Dashboard" or "My Account".
- Locate API Keys Section: Within the dashboard, look for a section specifically dedicated to "API Keys", "Developer Settings", or "Integrations". The exact label may vary but it will contain your API key management tools.
- Generate or Retrieve Key: If you haven't generated a key before, there will be an option to "Generate New API Key". If you already have one, it will be displayed (often partially masked for security) with options to copy or regenerate it.
- Copy Your Key: Securely copy your API key. This key is sensitive information and should be treated as a password.
Vector Express v2.0 provides a free tier that includes 50 API calls per month, which requires an authenticated account. Your API key will grant access to this tier and any subsequent paid plans you subscribe to, such as the Creator Plan, which offers 500 API calls per month starting at $19/month, as detailed on the Vector Express pricing page.
Authenticated request example
Here's an example of how to make an authenticated request to the Vector Express v2.0 API using Python, passing the API key in a custom HTTP header. This example assumes you are performing an image-to-SVG conversion.
import requests
API_KEY = "YOUR_VECTOR_EXPRESS_API_KEY"
API_ENDPOINT = "https://api.vector.express/v2/convert/image-to-svg"
# Path to your image file
image_file_path = "path/to/your/image.png"
headers = {
"X-API-Key": API_KEY,
"Content-Type": "application/octet-stream" # Or appropriate content type for your file
}
with open(image_file_path, 'rb') as f:
image_data = f.read()
try:
response = requests.post(API_ENDPOINT, headers=headers, data=image_data)
response.raise_for_status() # Raise an exception for HTTP errors (4xx or 5xx)
# Assuming the API returns the SVG directly
with open("output.svg", "wb") as out_file:
out_file.write(response.content)
print("Image successfully converted to SVG and saved as output.svg")
except requests.exceptions.HTTPError as err:
print(f"HTTP error occurred: {err}")
print(f"Response content: {response.text}")
except requests.exceptions.ConnectionError as err:
print(f"Connection error occurred: {err}")
except requests.exceptions.Timeout as err:
print(f"Request timed out: {err}")
except requests.exceptions.RequestException as err:
print(f"An unexpected error occurred: {err}")
In this example:
API_KEYshould be replaced with your actual key obtained from the Vector Express dashboard.- The
X-API-Keyheader is used to transmit the API key. - The image file data is sent in the request body.
- Error handling is included to manage common issues during API calls.
For more detailed examples and specific endpoint requirements, refer to the Vector Express v2.0 API Reference.
Security best practices
Securing your API keys is paramount to prevent unauthorized access to your Vector Express v2.0 account and services. Adhere to these best practices:
- Environment Variables: Never hardcode API keys directly into your source code. Instead, store them as environment variables (e.g.,
VECTOR_EXPRESS_API_KEY) on your server or in secure configuration files. This prevents keys from being exposed in version control systems. - Server-Side Usage: Always use your API keys from your backend server or a secure environment. Avoid exposing them in client-side code (e.g., JavaScript in a web browser or mobile app), as this makes them vulnerable to interception.
- Access Control: Implement strict access controls for anyone who has access to your API keys. Limit access to only necessary personnel and systems.
- HTTPS/TLS: All communication with the Vector Express v2.0 API occurs over HTTPS. Ensure that your application also enforces HTTPS for all its communications to protect data in transit, including your API key. This is a fundamental principle of secure data transmission.
- Key Rotation: Regularly rotate your API keys. This means generating a new key from your Vector Express dashboard and updating your applications with the new key. This practice minimizes the risk if a key is compromised without your knowledge.
- Monitoring and Logging: Monitor your API usage for any unusual activity. Implement logging to track API calls and responses, which can help detect and diagnose potential security incidents.
- Least Privilege: If Vector Express v2.0 were to support granular permissions (currently, API keys typically grant full access to your account's API capabilities), you would generate keys with the minimum necessary permissions for each application. While not currently a feature for Vector Express v2.0 API keys, it's a general principle for API security.
- Error Handling: Implement robust error handling in your applications. Avoid logging sensitive information, such as API keys, in error messages or publicly accessible logs.
By diligently following these guidelines, you can significantly reduce the risk of unauthorized access and maintain the integrity of your Vector Express v2.0 integrations.