Endpoint API
Riferimento completo per tutti gli endpoint della REST API Screenzzie
docs.apiCtaBanner.title
docs.apiCtaBanner.description
Riferimento Endpoint API
Documentazione completa per tutti gli endpoint REST API disponibili.
Organizzazione e Introspezione
Ottiene informazioni sul Suo contesto API e organizzazione corrente.
Ottieni Contesto Corrente
GET /api/v1/me
Restituisce informazioni sulla Sua API key, organizzazione, limiti di frequenza e funzionalita disponibili. Questo endpoint non conta per il Suo limite di frequenza.
Richiesta di Esempio:
curl -X GET "https://www.screenzzie.com/api/v1/me" \
-H "Authorization: Bearer sk_live_xxx"
Risposta di Esempio:
{
"success": true,
"data": {
"apiKey": {
"id": "uuid",
"name": "My API Key",
"keyPrefix": "sk_live_abc123",
"scopes": ["screens:read", "screens:write", "playlists:read"],
"expiresAt": null,
"lastUsedAt": "2024-01-15T10:30:00Z"
},
"organization": {
"id": "uuid",
"name": "My Company",
"planId": "growth",
"subscriptionStatus": "active",
"trialEndsAt": null,
"maxScreensAllowed": 50,
"activeScreensCount": 12
},
"rateLimits": {
"limit": 100000,
"used": 45,
"remaining": 99955,
"resetAtMs": 1704153600000
},
"features": {
"sequences": true,
"schedules": true,
"api": true
}
}
}
Lista Organizzazioni
GET /api/v1/organizations
Restituisce le organizzazioni accessibili con la Sua API key. Attualmente, ogni API key appartiene a esattamente un'organizzazione.
Parametri Query:
| Parametro | Tipo | Descrizione |
|---|---|---|
page | number | Numero pagina (default: 1) |
limit | number | Elementi per pagina (default: 20, max: 100) |
Richiesta di Esempio:
curl -X GET "https://www.screenzzie.com/api/v1/organizations" \
-H "Authorization: Bearer sk_live_xxx"
Risposta di Esempio:
{
"success": true,
"data": {
"items": [
{
"id": "uuid",
"name": "My Company",
"planId": "growth",
"subscriptionStatus": "active",
"maxScreensAllowed": 50,
"activeScreensCount": 12,
"createdAt": "2024-01-01T00:00:00Z"
}
],
"pagination": {
"page": 1,
"limit": 20,
"total": 1,
"totalPages": 1,
"hasMore": false
}
}
}
Schermi
Gestisca i Suoi schermi di digital signage.
Lista Schermi
GET /api/v1/screens
Parametri Query:
| Parametro | Tipo | Descrizione |
|---|---|---|
page | number | Numero pagina (default: 1) |
limit | number | Elementi per pagina (default: 20, max: 100) |
isActive | boolean | Filtra per stato attivo |
isOnline | boolean | Filtra per stato online |
screenGroupId | uuid | Filtra per gruppo schermi |
workspaceId | uuid | Filtra per workspace |
Richiesta di Esempio:
curl -X GET "https://www.screenzzie.com/api/v1/screens?isOnline=true&limit=10" \
-H "Authorization: Bearer sk_live_xxx"
Risposta di Esempio:
{
"success": true,
"data": {
"items": [
{
"id": "uuid",
"name": "Lobby Display",
"description": "Main entrance screen",
"isActive": true,
"isOnline": true,
"lastSeenAt": "2024-01-01T12:00:00Z",
"orientation": "landscape",
"rotation": "0",
"timezone": "Europe/Madrid",
"location": "Building A, Floor 1",
"cityName": "Madrid",
"latitude": 40.4168,
"longitude": -3.7038,
"workspaceId": "uuid",
"screenGroupId": null,
"currentPlaylistId": "uuid",
"currentSequenceId": null,
"defaultPlaylistId": "uuid",
"defaultSequenceId": null,
"createdAt": "2024-01-01T00:00:00Z",
"updatedAt": "2024-01-01T12:00:00Z"
}
],
"pagination": {
"page": 1,
"limit": 10,
"total": 25,
"totalPages": 3,
"hasMore": true
}
}
}
Ottieni Schermo
GET /api/v1/screens/:screenId
Parametri Path:
| Parametro | Tipo | Descrizione |
|---|---|---|
screenId | uuid | L'ID dello schermo |
Risposta di Esempio:
Restituisce un singolo oggetto schermo con la stessa struttura della risposta lista.
Crea Schermo
POST /api/v1/screens
Corpo della Richiesta:
| Campo | Tipo | Richiesto | Descrizione |
|---|---|---|---|
name | string | Si | Nome schermo (max 100 caratteri) |
description | string | No | Descrizione schermo (max 500 caratteri) |
orientation | string | No | landscape o portrait (default: landscape) |
rotation | string | No | 0, 90, 180 o 270 (default: 0) |
timezone | string | No | Fuso orario IANA (es. Europe/Madrid) |
location | string | No | Descrizione posizione fisica (max 200 caratteri) |
screenGroupId | uuid | No | Appartenenza gruppo schermi |
workspaceId | uuid | No | Assegnazione workspace |
Le assegnazioni playlist e sequenza non possono essere impostate durante la creazione. Usi l'endpoint Aggiorna Schermo per assegnare contenuti dopo la creazione.
Richiesta di Esempio:
curl -X POST "https://www.screenzzie.com/api/v1/screens" \
-H "Authorization: Bearer sk_live_xxx" \
-H "Content-Type: application/json" \
-d '{
"name": "Conference Room A",
"orientation": "landscape",
"rotation": "0",
"timezone": "Europe/Madrid",
"location": "Building B, Room 101"
}'
Risposta di Esempio:
{
"success": true,
"data": {
"id": "uuid",
"name": "Conference Room A",
"description": null,
"isActive": true,
"isOnline": false,
"lastSeenAt": null,
"orientation": "landscape",
"rotation": "0",
"timezone": "Europe/Madrid",
"location": "Building B, Room 101",
"cityName": null,
"latitude": null,
"longitude": null,
"workspaceId": null,
"screenGroupId": null,
"currentPlaylistId": null,
"currentSequenceId": null,
"defaultPlaylistId": null,
"defaultSequenceId": null,
"createdAt": "2024-01-01T00:00:00Z",
"updatedAt": "2024-01-01T00:00:00Z"
}
}
Aggiorna Schermo
PATCH /api/v1/screens/:screenId
Tutti i campi sono opzionali. Includa solo i campi che desidera aggiornare.
Corpo della Richiesta:
| Campo | Tipo | Descrizione |
|---|---|---|
name | string | Nuovo nome schermo (max 100 caratteri) |
description | string | Nuova descrizione (null per cancellare) |
orientation | string | landscape o portrait |
rotation | string | 0, 90, 180 o 270 |
timezone | string | Fuso orario IANA |
location | string | Posizione fisica (null per cancellare) |
workspaceId | uuid | ID workspace (null per rimuovere) |
screenGroupId | uuid | ID gruppo schermi (null per rimuovere) |
currentPlaylistId | uuid | Playlist corrente (null per rimuovere) |
currentSequenceId | uuid | Sequenza corrente (null per rimuovere) |
defaultPlaylistId | uuid | Playlist predefinita (null per rimuovere) |
defaultSequenceId | uuid | Sequenza predefinita (null per rimuovere) |
Richiesta di Esempio:
curl -X PATCH "https://www.screenzzie.com/api/v1/screens/abc123" \
-H "Authorization: Bearer sk_live_xxx" \
-H "Content-Type: application/json" \
-d '{
"name": "Updated Display Name",
"currentPlaylistId": "playlist-uuid"
}'
Playlist
Gestisca le playlist di contenuti per i Suoi schermi.
Lista Playlist
GET /api/v1/playlists
Parametri Query:
| Parametro | Tipo | Descrizione |
|---|---|---|
page | number | Numero pagina (default: 1) |
limit | number | Elementi per pagina (default: 20, max: 100) |
workspaceId | uuid | Filtra per workspace |
Risposta di Esempio:
{
"success": true,
"data": {
"items": [
{
"id": "uuid",
"name": "Main Content",
"description": "Primary playlist for lobby screens",
"itemCount": 5,
"totalDuration": 120,
"workspaceId": null,
"createdBy": "user-uuid",
"createdAt": "2024-01-01T00:00:00Z",
"updatedAt": "2024-01-01T12:00:00Z"
}
],
"pagination": { ... }
}
}
Ottieni Playlist
GET /api/v1/playlists/:playlistId
Restituisce la playlist con i suoi elementi. Gli elementi sono sempre inclusi nella risposta.
Parametri Path:
| Parametro | Tipo | Descrizione |
|---|---|---|
playlistId | uuid | L'ID della playlist |
Risposta di Esempio:
{
"success": true,
"data": {
"id": "uuid",
"name": "Main Content",
"description": "Primary playlist for lobby screens",
"itemCount": 2,
"totalDuration": 45,
"workspaceId": null,
"createdBy": "user-uuid",
"createdAt": "2024-01-01T00:00:00Z",
"updatedAt": "2024-01-01T12:00:00Z",
"items": [
{
"id": "item-uuid-1",
"position": 0,
"duration": 15,
"itemType": "media",
"mediaId": "media-uuid",
"config": null,
"createdAt": "2024-01-01T00:00:00Z"
},
{
"id": "item-uuid-2",
"position": 1,
"duration": 30,
"itemType": "website",
"mediaId": null,
"config": { "url": "https://example.com" },
"createdAt": "2024-01-01T00:00:00Z"
}
]
}
}
Crea Playlist
POST /api/v1/playlists
Corpo della Richiesta:
| Campo | Tipo | Richiesto | Descrizione |
|---|---|---|---|
name | string | Si | Nome playlist (max 100 caratteri) |
description | string | No | Descrizione playlist (max 500 caratteri) |
workspaceId | uuid | No | Assegnazione workspace |
Richiesta di Esempio:
curl -X POST "https://www.screenzzie.com/api/v1/playlists" \
-H "Authorization: Bearer sk_live_xxx" \
-H "Content-Type: application/json" \
-d '{
"name": "Holiday Promotions",
"description": "Seasonal content for December"
}'
Aggiorna Playlist
PATCH /api/v1/playlists/:playlistId
Corpo della Richiesta:
| Campo | Tipo | Descrizione |
|---|---|---|
name | string | Nuovo nome playlist |
description | string | Nuova descrizione (null per cancellare) |
workspaceId | uuid | ID workspace (null per rimuovere) |
Elimina Playlist
DELETE /api/v1/playlists/:playlistId
Restituisce 204 No Content in caso di successo.
Media
Acceda e registri file media nella Sua libreria.
Lista Media
GET /api/v1/media
Parametri Query:
| Parametro | Tipo | Descrizione |
|---|---|---|
page | number | Numero pagina (default: 1) |
limit | number | Elementi per pagina (default: 20, max: 100) |
type | string | Filtra per tipo: image o video |
folderId | uuid | Filtra per cartella |
workspaceId | uuid | Filtra per workspace |
Risposta di Esempio:
{
"success": true,
"data": {
"items": [
{
"id": "uuid",
"name": "promo-video.mp4",
"type": "video",
"fileUrl": "https://...",
"thumbnailUrl": "https://...",
"fileSize": 15728640,
"duration": 30,
"folderId": null,
"workspaceId": null,
"uploadedBy": "user-uuid",
"createdAt": "2024-01-01T00:00:00Z",
"updatedAt": "2024-01-01T00:00:00Z"
}
],
"pagination": { ... }
}
}
Ottieni Media
GET /api/v1/media/:mediaId
Restituisce un singolo oggetto media con la stessa struttura della risposta lista.
Registra Media
POST /api/v1/media
Registra un file media che e gia stato caricato nello storage. Questo endpoint non gestisce i caricamenti di file direttamente - usi la dashboard web per i caricamenti di file.
Corpo della Richiesta:
| Campo | Tipo | Richiesto | Descrizione |
|---|---|---|---|
name | string | Si | Nome media (max 200 caratteri) |
type | string | Si | image o video |
fileUrl | string | Si | URL del file caricato |
thumbnailUrl | string | No | URL della miniatura |
fileSize | number | No | Dimensione file in byte |
duration | number | No | Durata in secondi (per video) |
folderId | uuid | No | Assegnazione cartella |
workspaceId | uuid | No | Assegnazione workspace |
Richiesta di Esempio:
curl -X POST "https://www.screenzzie.com/api/v1/media" \
-H "Authorization: Bearer sk_live_xxx" \
-H "Content-Type: application/json" \
-d '{
"name": "Company Logo",
"type": "image",
"fileUrl": "https://your-storage.com/logo.png",
"thumbnailUrl": "https://your-storage.com/logo-thumb.png",
"fileSize": 102400
}'
Il caricamento diretto dei file non e disponibile tramite la REST API. Carichi i file tramite la dashboard web, oppure li carichi sul Suo storage e registri l'URL usando questo endpoint.
Elimina Media
DELETE /api/v1/media/:mediaId
Restituisce 204 No Content in caso di successo.
Programmazioni
Le programmazioni sono disponibili solo con il piano Growth e superiori.
Programmi i contenuti per riprodurli in orari specifici.
Lista Programmazioni
GET /api/v1/schedules
Parametri Query:
| Parametro | Tipo | Descrizione |
|---|---|---|
page | number | Numero pagina (default: 1) |
limit | number | Elementi per pagina (default: 20, max: 100) |
workspaceId | uuid | Filtra per workspace |
screenId | uuid | Filtra per schermo |
isActive | boolean | Filtra per stato attivo |
Risposta di Esempio:
{
"success": true,
"data": {
"items": [
{
"id": "uuid",
"name": "Weekend Promotions",
"playlistId": "playlist-uuid",
"sequenceId": null,
"screenId": null,
"screenGroupId": null,
"targetType": "all_screens",
"dayOfWeek": [0, 6],
"startTime": "09:00",
"endTime": "21:00",
"startDate": null,
"endDate": null,
"priority": 10,
"isActive": true,
"color": "#3B82F6",
"workspaceId": null,
"createdAt": "2024-01-01T00:00:00Z",
"updatedAt": "2024-01-01T00:00:00Z"
}
],
"pagination": { ... }
}
}
Ottieni Programmazione
GET /api/v1/schedules/:scheduleId
Restituisce un singolo oggetto programmazione con la stessa struttura della risposta lista.
Crea Programmazione
POST /api/v1/schedules
Corpo della Richiesta:
| Campo | Tipo | Richiesto | Descrizione |
|---|---|---|---|
name | string | No | Nome programmazione (max 100 caratteri) |
playlistId | uuid | No* | Playlist da programmare |
sequenceId | uuid | No* | Sequenza da programmare |
targetType | string | Si | screen, screen_group, all_screens o multiple_screens |
screenId | uuid | Condizionale | Richiesto se targetType e screen |
screenGroupId | uuid | Condizionale | Richiesto se targetType e screen_group |
dayOfWeek | number[] | No | Giorni della settimana (0=Dom, 6=Sab) |
startTime | string | No | Ora di inizio in formato HH:MM |
endTime | string | No | Ora di fine in formato HH:MM |
startDate | string | No | Data di inizio in formato ISO |
endDate | string | No | Data di fine in formato ISO |
priority | number | No | Priorita 0-100 (default: 0) |
isActive | boolean | No | Se attiva (default: true) |
color | string | No | Colore visualizzazione (es. #3B82F6) |
workspaceId | uuid | No | Assegnazione workspace |
*O playlistId o sequenceId dovrebbero essere forniti per programmare contenuti.
Requisiti Condizionali Target Type:
| targetType | Campi Richiesti |
|---|---|
screen | screenId |
screen_group | screenGroupId |
all_screens | Nessuno |
multiple_screens | Nessuno (usi endpoint separato per aggiungere schermi) |
Richiesta di Esempio:
curl -X POST "https://www.screenzzie.com/api/v1/schedules" \
-H "Authorization: Bearer sk_live_xxx" \
-H "Content-Type: application/json" \
-d '{
"name": "Weekend Promotions",
"playlistId": "abc123",
"targetType": "all_screens",
"dayOfWeek": [0, 6],
"startTime": "09:00",
"endTime": "21:00",
"priority": 10,
"color": "#3B82F6"
}'
Aggiorna Programmazione
PATCH /api/v1/schedules/:scheduleId
Tutti i campi sono opzionali. Usa le stesse definizioni dei campi di Crea Programmazione.
Elimina Programmazione
DELETE /api/v1/schedules/:scheduleId
Restituisce 204 No Content in caso di successo.
Codici di Stato HTTP
| Codice | Descrizione |
|---|---|
200 | Successo |
201 | Creato |
204 | Nessun Contenuto (eliminazione riuscita) |
400 | Richiesta Non Valida (errore di validazione) |
401 | Non Autorizzato (API key non valida) |
403 | Vietato (permessi o piano insufficienti) |
404 | Non Trovato |
429 | Troppe Richieste (limite di frequenza) |
500 | Errore Interno del Server |