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/upload
API Endpoints
Section titled “API Endpoints”Upload Image:
- Endpoint:
POST /api/external/upload
- Authentication: Required (API Key)
- Body: Multipart form data with
image
field - 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 Integration
Section titled “ShareX Integration”Slink provides built-in ShareX integration for seamless screenshot and image uploads.
Automatic Configuration
Section titled “Automatic Configuration”-
Create an API Key (see steps above)
-
Download ShareX Config
After creating a new API key, click “Download ShareX Config” to get a pre-configured
.sxcu
file. -
Import to ShareX
Double-click the downloaded
.sxcu
file or import it manually in ShareX under:Destinations → Custom uploaders → Import → From file
Manual ShareX Configuration
Section titled “Manual ShareX Configuration”If you prefer manual setup:
- Open ShareX and go to
Destinations → Custom uploaders
- Click
New
to create a new uploader - Configure the following settings:
- Name: Slink
- Method: POST
- Request URL:
https://your-slink-instance.com/api/external/upload
- Headers:
Authorization: Bearer your_api_key_here
- Body:
Form data (multipart/form-data)
- File form name:
image
- URL:
$json:url$
Security Best Practices
Section titled “Security Best Practices”Key Management
Section titled “Key Management”- Use descriptive names to identify where each key is used
- Set expiration dates for keys used in temporary or testing scenarios
- Rotate keys regularly for enhanced security
- Revoke unused keys to minimize attack surface
Access Control
Section titled “Access Control”- One key per application - Don’t share keys between different tools or scripts
- Monitor usage - Check the “Last Used” field to identify inactive keys
- Environment variables - Store API keys in environment variables, not in code
Key Storage
Section titled “Key Storage”- Never commit to version control - Add API keys to your
.gitignore
- Use secure storage - Consider using password managers or secure vaults
- Limit access - Only share keys with team members who need them