Zum Inhalt springen

Apps

Apps sind die grundlegenden Entitäten in Capgo. Jede App stellt eine eindeutige Capacitor-Anwendung dar, die Sie über die Plattform verwalten und aktualisieren können. Die Apps API ermöglicht es Ihnen, App-Konfigurationen zu erstellen, abzurufen, zu aktualisieren und zu löschen.

Eine App in Capgo stellt Ihre Capacitor-Anwendung dar und umfasst:

  • App-ID: Eindeutige Kennung für Ihre Anwendung
  • Name: Menschlich lesbarer Name Ihrer Anwendung
  • Icons: Visuelle Kennzeichnungen für Ihre App im Dashboard
  • Konfiguration: Einstellungen, die steuern, wie Updates ausgeliefert werden
  • Eigentümer: Informationen zu Organisation und Benutzerzugriff
  • Nutzungsstatistiken: Metriken zu Installationen und Updates
  1. Namenskonvention: Verwenden Sie klare, identifizierbare Namen für Ihre Apps
  2. Sicherheit: Schütze deine API Keys und Zugangsdaten
  3. Organisation: Gruppiere zusammengehörige Apps unter derselben Organisation
  4. Monitoring: Überprüfe regelmäßig App-Statistiken und Performance
  5. Backup: Erstelle Konfigurations-Backups für kritische Apps

https://api.capgo.app/app/

Ruft Informationen zu deinen Apps ab.

  • page: Optional. Seitenzahl für die Pagination
  • limit: Optional. Anzahl der Ergebnisse pro Seite (Standard: 50)
  • org_id: Optional. Filtert Apps nach der Organisations-ID. Falls nicht angegeben, werden Apps aller Organisationen zurückgegeben, auf die der Nutzer Zugriff hat

Um eine bestimmte App abzurufen:

  • Verwende die App-ID im URL-Pfad: https://api.capgo.app/app/:app_id

Hinweis: last_version bezieht sich auf das zuletzt hochgeladene Bundle (Version) der App.

interface App {
app_id: string
block_provider_infra_requests: boolean
created_at: string | null
default_upload_channel: string
icon_url: string
id: string | null
last_version: string | null // last bundle (version) name
name: string | null
owner_org: string
retention: number
transfer_history: Json[] | null
updated_at: string | null
user_id: string | null
}
Terminalfenster
# Get all apps
curl -H "authorization: your-api-key" \
"https://api.capgo.app/app/"
# Get apps from a specific organization
curl -H "authorization: your-api-key" \
"https://api.capgo.app/app/?org_id=046a36ac-e03c-4590-9257-bd6c9dba9ee8"
# Get specific app
curl -H "authorization: your-api-key" \
"https://api.capgo.app/app/com.demo.app"
{
"data": [
{
"block_provider_infra_requests": true,
"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/

Neue App erstellen.

interface CreateApp {
app_id: string
name: string
icon?: string
owner_org: string
}
Terminalfenster
# Create new app
curl -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/
{
"block_provider_infra_requests": true,
"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

Aktualisiert eine bestehende App. Die App-ID wird im URL-Pfad angegeben.

interface UpdateApp {
block_provider_infra_requests?: boolean
name?: string
icon?: string
retention?: number
}
Terminalfenster
curl -X PUT \
-H "authorization: your-api-key" \
-H "Content-Type: application/json" \
-d '{
"block_provider_infra_requests": true,
"name": "Updated App Name",
"icon": "https://example.com/updated-icon.png",
"retention": 45
}' \
https://api.capgo.app/app/com.demo.app
{
"app_id": "com.demo.app",
"created_at": "2024-01-01T00:00:00Z",
"default_upload_channel": "dev",
"block_provider_infra_requests": true,
"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"
}

https://api.capgo.app/app/:app_id

Löscht eine App und alle zugehörigen Ressourcen. Die App-ID wird im URL-Pfad angegeben. Mit äußerster Vorsicht verwenden, da diese Aktion nicht rückgängig gemacht werden kann.

Terminalfenster
curl -X DELETE \
-H "authorization: your-api-key" \
https://api.capgo.app/app/com.demo.app
{
"status": "ok"
}

Alle Fehler verwenden das Standardfehlerformat, das in der API Übersicht.

Häufige Fehlerszenarien und deren Antworten:

// Missing or invalid API key (HTTP 401)
{
"error": "invalid_apikey",
"message": "Invalid apikey",
"moreInfo": {}
}
// app_id is not a reverse-domain identifier
{
"error": "invalid_app_id",
"message": "App ID must be a reverse domain string",
"moreInfo": { "app_id": "my app" }
}
// The API key has no access to this app (HTTP 401)
{
"error": "cannot_access_app",
"message": "You can't access this app",
"moreInfo": { "app_id": "com.example.app" }
}
// Creating an app in an organization the key cannot write to (HTTP 403)
{
"error": "cannot_access_organization",
"message": "You can't access this organization",
"moreInfo": { "org_id": "046a36ac-e03c-4590-9257-bd6c9dba9ee8" }
}
// Retention above the two-year limit on update
{
"error": "retention_to_big",
"message": "Retention cannot be bigger than 63113903 (2 years)",
"moreInfo": { "retention": 99999999 }
}
  1. Neue App erstellen
// Set up a new app
{
"name": "Production App",
"owner_org": "046a36ac-e03c-4590-9257-bd6c9dba9ee8"
}
  1. App-Konfiguration aktualisieren
// Change app name and icon
{
"name": "Rebranded App Name",
"icon": "https://example.com/new-icon.png"
}
  1. Retention Policy festlegen
// Configure automatic bundle cleanup
{
"retention": 30 // Keep bundles for 30 days
}
  1. Apps nach Organisation abrufen
Terminalfenster
# List all apps in a specific organization
curl -H "authorization: your-api-key" \
"https://api.capgo.app/app/?org_id=046a36ac-e03c-4590-9257-bd6c9dba9ee8"
  1. Speicheroptimierung: Überwache die Speichernutzung und lege passende Aufbewahrungsrichtlinien fest
  2. Organisation: Gruppiere zusammengehörige Apps unter einer einzigen Organisation
  3. Zugriffskontrolle: Verwalte, welche Teammitglieder die App-Einstellungen ändern dürfen
  4. Backup-Strategie: Sichere kritische App-Konfigurationen und Einstellungen

Wenn du es nutzt Apps um Dashboard- und API-Operationen zu planen, verbinde es mit API Übersicht für Details zur Implementierung im API Overview, Einführung für die Implementierungsdetails in der Einleitung, API Schlüssel für die Implementierungsdetails in API Keys, Geräte für die Implementierungsdetails in Devices und Bundles für die Implementierungsdetails in Bundles.