API Key Management
API keys provide a secure way to authenticate with Slink’s API for external integrations and automated uploads. They’re perfect for tools like ShareX or custom scripts that need to upload images programmatically.
Creating API Keys
Section titled “Creating API Keys”-
Navigate to Your Profile
Go to your user profile page and click on the “API Keys” tab.
-
Create New API Key
Click the “Create API Key” button to open the creation dialog.
-
Configure Your Key
- Name: Give your API key a descriptive name (e.g., “ShareX Upload Key”, “Automation Script”)
- Expiry Date (Optional): Set an expiration date for enhanced security, or leave empty for a permanent key
-
Save and Store Securely
Once created, copy and store your API key immediately. It will only be shown once and cannot be recovered if lost.
Using API Keys
Section titled “Using API Keys”API keys are used in the Authorization header with the Bearer prefix:
curl -X POST \ -H "Authorization: Bearer sk_your_api_key_here" \ -F "image=@/path/to/your/image.jpg" \ https://your-slink-instance.com/api/external/uploadAPI Endpoints
Section titled “API Endpoints”Upload Image:
- Endpoint:
POST /api/external/upload - Authentication: Required (API Key)
- Body: Multipart form data with
imagefield - Response: JSON with image URL and metadata
ShareX Integration:
- Endpoint:
GET /api/user/sharex-config?baseUrl=<url>&apiKey=<key> - Authentication: Required (User login)
- Response: ShareX configuration file (.sxcu)
ShareX
Section titled “ShareX”Slink can generate a ready-to-use ShareX configuration from an API key. For setup, see the ShareX Integration guide.