Generating API Keys
Learn how to generate and manage API keys for third-party integrations and Live Feed connections
Overview
API keys in PrimeLink are used to authenticate external requests to your store's Live Feed endpoint. They allow other stores or applications to securely access your product data for real-time synchronization.
API keys are generated with a unique name and can be revoked at any time. Each key is a 32-character alphanumeric string that must be included in the request headers when accessing the Live Feed API.
Accessing API Key Management
To access the API Key management interface:
- Navigate to PrimeLink → Live Feed in your WordPress admin
- Click on the API Keys tab
- You'll see a list of all existing API keys (if any)
Generating a New API Key
Step 1: Open the Generate Modal
- In the API Keys tab, click the Create API Key button
- A modal window will open asking for a key name
Step 2: Enter Key Name
Enter a descriptive name for your API key. This helps you identify the key later:
- Example names: "Main Store Feed", "Supplier Connection", "Development Store"
- The name is for your reference only and doesn't affect functionality
Step 3: Generate the Key
- Click the Generate button
- PrimeLink will create a unique API key and display it immediately
Step 4: Save the Key
Copy the API key to a secure location:
- Use a password manager
- Store it in your configuration files (securely)
- Share it with authorized team members only
Using API Keys
API keys are used in HTTP request headers when accessing the Live Feed endpoint:
Request Format
GET /wp-json/mt-primelink/v1/live-feed/products
Headers:
X-API-Key: YOUR_API_KEY_HERE
Example cURL Request
curl -X GET "https://yourstore.com/wp-json/mt-primelink/v1/live-feed/products" \
-H "X-API-Key: abc123def456ghi789jkl012mno345pqr678stu901vwx234yz"
Example PHP Request
$response = wp_remote_get(
'https://yourstore.com/wp-json/mt-primelink/v1/live-feed/products',
array(
'headers' => array(
'X-API-Key' => 'YOUR_API_KEY_HERE'
)
)
);
Managing API Keys
Viewing All Keys
The API Keys tab displays all your keys with the following information:
- Key Name: The descriptive name you assigned
- Created: Date and time when the key was generated
- Last Used: Date and time when the key was last used (if ever)
- Status: Active or Revoked
Revoking API Keys
If you need to disable an API key (for security reasons or if it's been compromised):
- Find the key in the list
- Click the Revoke button next to it
- Confirm the action in the dialog
- The key status will change to "Revoked" and it will no longer work
Security Best Practices
- Use descriptive names: Name your keys clearly so you can identify their purpose
- Rotate keys regularly: Generate new keys periodically and revoke old ones
- Never share keys publicly: API keys should be treated like passwords
- Monitor usage: Check the "Last Used" column to identify unused keys
- Revoke compromised keys: If a key is exposed, revoke it immediately
- Use HTTPS: Always use secure connections when transmitting API keys
Next Steps
Learn how to set up Live Feed connections using API keys
Learn More →Use WooCommerce REST API credentials for Live Feed connections
Learn More →