Apps
Le Apps sono le entità fondamentali in Capgo. Ogni app rappresenta un’applicazione Capacitor unica che puoi gestire e aggiornare attraverso la piattaforma. L’API Apps ti permette di creare, recuperare, aggiornare ed eliminare configurazioni delle app.
Comprendere le Apps
Section titled “Comprendere le Apps”Un’app in Capgo rappresenta la tua applicazione Capacitor e include:
- App ID: Identificatore univoco per la tua applicazione
- Name: Nome leggibile della tua applicazione
- Icons: Identificatori visivi per la tua app nel dashboard
- Configuration: Impostazioni che controllano come vengono consegnati gli aggiornamenti
- Ownership: Informazioni sull’accesso dell’organizzazione e dell’utente
- Usage Statistics: Metriche su installazioni e aggiornamenti
Best Practices
Section titled “Best Practices”- Convenzione di denominazione: Usa nomi chiari e identificabili per le tue app
- Sicurezza: Proteggi le chiavi API e le credenziali di accesso
- Organizzazione: Raggruppa le app correlate sotto la stessa organizzazione
- Monitoraggio: Controlla regolarmente le statistiche e le prestazioni dell’app
- Backup: Mantieni backup delle configurazioni per le app critiche
Endpoints
Section titled “Endpoints”https://api.capgo.app/app/
Recupera informazioni sulle tue app.
Parametri Query
Section titled “Parametri Query”page: Opzionale. Numero di pagina per la paginazionelimit: Opzionale. Numero di risultati per pagina (predefinito: 50)org_id: Opzionale. Filtra le app per ID organizzazione. Se non fornito, restituisce le app da tutte le organizzazioni a cui l’utente ha accesso
Per ottenere un’app specifica:
- Usa l’ID dell’app nel percorso URL:
https://api.capgo.app/app/:app_id
Response Type
Section titled “Response Type”interface App { app_id: string created_at: string | null default_upload_channel: string icon_url: string id: string | null last_version: string | null name: string | null owner_org: string retention: number transfer_history: Json[] | null updated_at: string | null user_id: string | null}Example Request
Section titled “Example Request”# Get all appscurl -H "authorization: your-api-key" \ "https://api.capgo.app/app/"
# Get apps from a specific organizationcurl -H "authorization: your-api-key" \ "https://api.capgo.app/app/?org_id=046a36ac-e03c-4590-9257-bd6c9dba9ee8"
# Get specific appcurl -H "authorization: your-api-key" \ "https://api.capgo.app/app/com.demo.app"Example Response
Section titled “Example Response”{ "data": [ { "app_id": "com.demo.app", "created_at": "2024-01-01T00:00:00Z", "default_upload_channel": "dev", "icon_url": "https://example.com/icon.png", "id": "550e8400-e29b-41d4-a716-446655440000", "last_version": "1.0.0", "name": "Demo App", "owner_org": "046a36ac-e03c-4590-9257-bd6c9dba9ee8", "retention": 2592000, "transfer_history": null, "updated_at": "2024-01-01T00:00:00Z", "user_id": "6aa76066-55ef-4238-ade6-0b32334a4097" } ]}https://api.capgo.app/app/
Crea una nuova app.
Request Body
Section titled “Request Body”interface CreateApp { app_id: string name: string icon?: string owner_org: string}Example Request
Section titled “Example Request”# Create new appcurl -X POST \ -H "authorization: your-api-key" \ -H "Content-Type: application/json" \ -d '{ "name": "My New App", "app_id": "com.demo.myapp", // this id is unique in Capgo This cannot be reused by any account. "icon": "https://example.com/icon.png", "owner_org": "046a36ac-e03c-4590-9257-bd6c9dba9ee8" }' \ https://api.capgo.app/app/Success Response
Section titled “Success Response”{ "app_id": "My New App", "created_at": "2024-01-01T00:00:00Z", "default_upload_channel": "dev", "icon_url": "https://example.com/icon.png", "id": "550e8400-e29b-41d4-a716-446655440000", "name": "My New App", "owner_org": "046a36ac-e03c-4590-9257-bd6c9dba9ee8", "retention": 2592000, "updated_at": "2024-01-01T00:00:00Z"}https://api.capgo.app/app/:app_id
Aggiorna un’app esistente. L’ID dell’app è specificato nel percorso URL.
Request Body
Section titled “Request Body”interface UpdateApp { name?: string icon?: string retention?: number}Example Request
Section titled “Example Request”curl -X PUT \ -H "authorization: your-api-key" \ -H "Content-Type: application/json" \ -d '{ "name": "Updated App Name", "icon": "https://example.com/updated-icon.png", "retention": 45 }' \ https://api.capgo.app/app/com.demo.appSuccess Response
Section titled “Success Response”{ "app_id": "com.demo.app", "created_at": "2024-01-01T00:00:00Z", "default_upload_channel": "dev", "icon_url": "https://example.com/updated-icon.png", "id": "550e8400-e29b-41d4-a716-446655440000", "name": "Updated App Name", "owner_org": "046a36ac-e03c-4590-9257-bd6c9dba9ee8", "retention": 45, "updated_at": "2024-01-01T00:00:00Z"}DELETE
Section titled “DELETE”https://api.capgo.app/app/:app_id
Elimina un’app e tutte le risorse associate. L’ID dell’app è specificato nel percorso URL. Usare con estrema cautela poiché questa azione non può essere annullata.
Example Request
Section titled “Example Request”curl -X DELETE \ -H "authorization: your-api-key" \ https://api.capgo.app/app/com.demo.appSuccess Response
Section titled “Success Response”{ "status": "ok"}Gestione degli Errori
Section titled “Gestione degli Errori”Scenari di errore comuni e le loro risposte:
// App not found{ "error": "App not found", "status": "KO"}
// Duplicate custom ID{ "error": "Custom ID already in use", "status": "KO"}
// Invalid parameters{ "error": "Invalid app configuration", "status": "KO"}
// Permission denied{ "error": "Insufficient permissions to manage app", "status": "KO"}
// Organization access denied{ "status": "You do not have access to this organization"}Casi d’Uso Comuni
Section titled “Casi d’Uso Comuni”- Create New App
// Set up a new app{ "name": "Production App", "owner_org": "046a36ac-e03c-4590-9257-bd6c9dba9ee8"}- Update App Configuration
// Change app name and icon{ "name": "Rebranded App Name", "icon": "https://example.com/new-icon.png"}- Set Retention Policy
// Configure automatic bundle cleanup{ "retention": 30 // Keep bundles for 30 days}- Get Apps by Organization
# List all apps in a specific organizationcurl -H "authorization: your-api-key" \ "https://api.capgo.app/app/?org_id=046a36ac-e03c-4590-9257-bd6c9dba9ee8"Gestione delle Risorse
Section titled “Gestione delle Risorse”- Ottimizzazione dello Storage: Monitora l’utilizzo dello storage e imposta politiche di conservazione appropriate
- Organizzazione: Raggruppa le app correlate sotto un’unica organizzazione
- Controllo degli Accessi: Gestisci quali membri del team possono modificare le impostazioni dell’app
- Strategia di Backup: Esegui il backup di configurazioni e impostazioni critiche dell’app