One-Time Note
Erstelle programmatisch sichere One-Time Notes über unsere REST-API
🔒 One-Time Note API
Sichere, einmalig abrufbare Notizen programmatisch erstellen
REST API v1.0
Quick Start
🎯 Endpoint
POST
https://otn.go-ecommerce.de/api/notes
📋 Content-Type
application/json
⚡ Beispiel Request
curl -X POST "https://otn.go-ecommerce.de/api/notes" \
-H "Content-Type: application/json" \
-d '{
"message": "Meine geheime Nachricht",
"pwd": "optional123",
"expiration_date": "2025-12-31"
}'
Parameter
Parameter | Typ | Erforderlich | Beschreibung |
---|---|---|---|
message | string | ✅ Ja | Der Inhalt der One-Time Note |
pwd | string | ❌ Nein | Optionaler Passwortschutz |
expiration_date | string | ❌ Nein | Ablaufdatum (YYYY-MM-DD) Standard: heute + 14 Tage |
Erfolgreiche Response (201)
{
"success": true,
"data": {
"link": "https://otn.go-ecommerce.de/notes/abc123def456",
"password_protected": "y",
"expiration_date": "2025-12-31",
"access_key": "abc123def456"
},
"message": "One-Time Note created successfully"
}
📊 Response Felder
data.link
Vollständige URL zur Notiz
data.password_protected
"y" oder "n"
data.expiration_date
Ablaufdatum (YYYY-MM-DD)
data.access_key
Eindeutiger Zugangsschlüssel
Error Responses
400 - Validation Error
{
"success": false,
"error": {
"code": 400,
"message": "Field \"message\" is required and cannot be empty"
}
}
405 - Method Not Allowed
{
"success": false,
"error": {
"code": 405,
"message": "Method not allowed. Use POST."
}
}
Code-Beispiele
🟨 JavaScript (Fetch)
async function createNote(message, password = '', expirationDate = '') {
const data = { message };
if (password) data.pwd = password;
if (expirationDate) data.expiration_date = expirationDate;
const response = await fetch('https://otn.go-ecommerce.de/api/notes', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(data)
});
return await response.json();
}
// Verwendung
const result = await createNote(
'Meine geheime Nachricht',
'myPassword123',
'2025-12-31'
);
if (result.success) {
console.log('Note erstellt:', result.data.link);
}
🐍 Python (requests)
import requests
def create_note(message, password=None, expiration_date=None):
url = "https://otn.go-ecommerce.de/api/notes"
data = {"message": message}
if password:
data["pwd"] = password
if expiration_date:
data["expiration_date"] = expiration_date
response = requests.post(url, json=data)
return response.json()
# Verwendung
result = create_note(
message="Meine geheime Nachricht",
password="myPassword123",
expiration_date="2025-12-31"
)
if result["success"]:
print(f"Note erstellt: {result['data']['link']}")
🐘 PHP (cURL)
function createNote($message, $password = '', $expirationDate = '') {
$data = ['message' => $message];
if ($password) $data['pwd'] = $password;
if ($expirationDate) $data['expiration_date'] = $expirationDate;
$ch = curl_init('https://otn.go-ecommerce.de/api/notes');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
return json_decode($response, true);
}
// Verwendung
$result = createNote(
'Meine geheime Nachricht',
'myPassword123',
'2025-12-31'
);
if ($result['success']) {
echo "Note erstellt: " . $result['data']['link'];
}
Live-Test
Teste die API direkt in deinem Browser mit unserer interaktiven Test-Seite
API-Test öffnenSicherheit & Hinweise
🔒 Sicherheit
- • HTTPS in Produktion empfohlen
- • CORS für alle Origins aktiviert
- • Keine Authentifizierung erforderlich
- • Rate Limiting auf Server-Ebene empfohlen
ℹ️ Hinweise
- • Notizen sind nur einmal abrufbar
- • Standard-Ablauf: 14 Tage
- • UTF-8 Zeichenkodierung
- • JSON Content-Type erforderlich
Alle Informationen werden mit SSL verschlüsselt.