EventPics API
Die API ermöglicht es, Bilder automatisiert in ein EventPics‑Album hochzuladen – z. B. aus einer Fotobox‑Software.
Die API ermöglicht es, Bilder automatisiert in ein EventPics‑Album hochzuladen – z. B. aus einer Fotobox‑Software.
Den persönlichen API‑Schlüssel erhältst du direkt in der EventPics App oder in der Web‑App. Öffne dein Event und rufe die API‑Schlüssel‑Verwaltung auf.
Die folgenden Endpunkte stehen für Integrationen zur Verfügung. Alle Anfragen benötigen deinen API‑Key. Für geteventsandalbums den Key bitte im Header senden (empfohlen: Authorization: Bearer <API_KEY>, alternativ X-API-Key: <API_KEY>); für die Upload‑Endpunkte im JSON‑Body.
POST Upload‑URL abrufen
https://api.eventpics.net/getuploadurl
Parameter (JSON Body)
apiKey: string (required)linkId: string (required)albumId: string (optional)fileName: string (required)takenAt: number (optional) – Unix‑Zeitstempel in MillisekundenAntwort
uploadUrl: stringGET Events und Alben abrufen
https://api.eventpics.net/geteventsandalbums
Authentifizierung
Authorization: Bearer YOUR_API_KEY (empfohlen)X-API-Key: YOUR_API_KEYAntwort
events: Array von Objekten mit title, linkId, albumsSo funktioniert der Upload‑Flow. Die uploadUrl ist ca. 300 Sekunden gültig.
GET https://api.eventpics.net/geteventsandalbums
Authorization: Bearer YOUR_API_KEY (oder X-API-Key){
"headers": {
"Authorization": "Bearer YOUR_API_KEY"
}
}
{
"events": [
{
"title": "Sommerfest",
"linkId": "abcd1234",
"albums": [
{ "id": "a1", "title": "Fotobox" },
{ "id": "a2", "title": "Backstage" }
]
}
]
}
const res = await fetch('https://api.eventpics.net/geteventsandalbums', {
headers: { Authorization: 'Bearer YOUR_API_KEY' },
cache: 'no-store'
});
const data = await res.json();
POST https://api.eventpics.net/getuploadurl
{
"apiKey": "YOUR_API_KEY",
"linkId": "abcd1234",
"fileName": "bild.jpg",
"takenAt": 1736700000000,
"albumId": "a1" // optional
}
{
"uploadUrl": "https://..."
}
const body = { apiKey: 'YOUR_API_KEY', linkId: 'abcd1234', fileName: 'bild.jpg', takenAt: Date.now() };
const res = await fetch('https://api.eventpics.net/getuploadurl', {
method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(body)
});
const { uploadUrl } = await res.json();
PUT uploadUrl (von Schritt 2)
Content-Type passend setzen, z. B. image/jpeg// Browser: Blob/File
await fetch(uploadUrl, { method: 'PUT', headers: { 'Content-Type': 'image/jpeg' }, body: fileBlob });
// Node.js: Buffer
const fs = await import('fs');
const bytes = await fs.promises.readFile('./bild.jpg');
await fetch(uploadUrl, { method: 'PUT', headers: { 'Content-Type': 'image/jpeg' }, body: bytes });