Authentication

The Online File Opener API uses API Keys to authenticate requests. You can view and manage your API keys in the Dashboard.

Getting an API Key

  1. Log in to your Online File Opener account.
  2. Navigate to the Settings page in your dashboard.
  3. Locate the API Keys section.
  4. Click Generate New Key.
  5. Copy the key immediately. You won't be able to see it again!

Using the API Key

Authentication to the API is performed via HTTP Headers. Provide your API key as the value for the X-API-Key header.

cURL Example
curl -X GET "https://api.onlinefileopener.com/api/v1/users/me" \
  -H "accept: application/json" \
  -H "X-API-Key: YOUR_API_KEY_HERE"

Python Example

Here's how to authenticate using the Python requests library.

Python Request
import requests

url = "https://api.onlinefileopener.com/api/v1/users/me"
headers = {
    "X-API-Key": "YOUR_API_KEY_HERE"
}

response = requests.get(url, headers=headers)

if response.status_code == 200:
    print("Success:", response.json())
else:
    print("Error:", response.status_code)

Authentication Errors

401 Unauthorized

This error occurs if the API key is missing, invalid, or expired.

403 Forbidden

This error occurs if the API key is valid but does not have permission to access the requested resource (e.g., admin-only endpoints).