Manage API keys for domain integration
Create a new API key for domain integration
| API Key | Domain | Name | Requests | Rate Limit | Status | Expires | Actions |
|---|---|---|---|---|---|---|---|
| No API keys yet. Generate your first API key above! | |||||||
How to use your API keys
https://mbsm.ch/api/v2/
# Using Header
X-API-Key: YOUR_API_KEY
# Using Query Parameter
?api_key=YOUR_API_KEY
curl -X POST https://mbsm.ch/api/v2/shorten \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url":"https://example.com/long/url","custom":"mycode"}'
curl -X GET "https://mbsm.ch/api/v2/stats" \
-H "X-API-Key: YOUR_API_KEY"
curl -X GET "https://mbsm.ch/api/v2/links?limit=50&offset=0" \
-H "X-API-Key: YOUR_API_KEY"
// Using fetch API
fetch('https://mbsm.ch/api/v2/shorten', {
method: 'POST',
headers: {
'X-API-Key': 'YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({url: 'https://example.com'})
})
.then(res => res.json())
.then(data => console.log(data));
<?php
$ch = curl_init('https://mbsm.ch/api/v2/shorten');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'X-API-Key: YOUR_API_KEY',
'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
'url' => 'https://example.com'
]));
$response = curl_exec($ch);
$data = json_decode($response, true);
print_r($data);
?>