The Online File Opener API uses API Keys to authenticate requests. You can view and manage your API keys in the Dashboard.
Authentication to the API is performed via HTTP Headers. Provide your API key as the value for the X-API-Key header.
curl -X GET "https://api.onlinefileopener.com/api/v1/users/me" \ -H "accept: application/json" \ -H "X-API-Key: YOUR_API_KEY_HERE"
Here's how to authenticate using the Python requests library.
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)This error occurs if the API key is missing, invalid, or expired.
This error occurs if the API key is valid but does not have permission to access the requested resource (e.g., admin-only endpoints).