Перейти к содержимому

Upload API

Это содержимое пока не доступно на вашем языке.

Fenfa exposes an HTTP API for uploading build artifacts from CI/CD pipelines and managing the distribution lifecycle.

All API requests require a token in the X-Auth-Token header:

X-Auth-Token: your-api-token

Tokens are created in the Fenfa admin dashboard under Settings.

Upload a build artifact to a specific variant.

Content-Type: multipart/form-data

FieldTypeRequiredDescription
variant_idstringYesTarget variant ID
app_filefileYesThe binary artifact (IPA, APK, DMG, EXE, etc.)
versionstringYesSemantic version (e.g., 2.1.5)
buildstringYesBuild number (e.g., 142)
changelogstringNoRelease notes (Markdown supported)

Fenfa automatically computes a SHA-256 hash of the uploaded file for integrity verification.

Example:

Terminal window
curl -X POST https://fenfa.example.com/upload \
-H "X-Auth-Token: your-api-token" \
-F "variant_id=abc123" \
-F "app_file=@build/MyApp.ipa" \
-F "version=2.1.5" \
-F "build=142" \
-F "changelog=Fixed login crash on iOS 18"

Response:

{
"success": true,
"release": {
"id": "rel_abc123",
"version": "2.1.5",
"build": "142",
"sha256": "e3b0c44298fc1c149afbf4c8996fb924...",
"download_url": "https://fenfa.example.com/d/rel_abc123",
"install_url": "itms-services://?action=download-manifest&url=...",
"qr_code_url": "https://fenfa.example.com/qr/rel_abc123"
}
}

The response includes platform-appropriate URLs:

  • download_url — Direct download link (all platforms)
  • install_url — iOS OTA installation link (IPA only)
  • qr_code_url — QR code image for the download page

Upload a binary to extract its metadata without creating a release. Useful for inspecting build artifacts.

Terminal window
curl -X POST https://fenfa.example.com/admin/api/parse-app \
-H "X-Auth-Token: your-api-token" \
-F "file=@build/MyApp.apk"

Returns parsed metadata such as bundle ID, version, minimum OS version, permissions, and icon.

The admin API provides full management of the distribution platform.

MethodEndpointDescription
GET/admin/api/productsList all products
POST/admin/api/productsCreate a product
GET/admin/api/products/:idGet product details
PUT/admin/api/products/:idUpdate a product
DELETE/admin/api/products/:idDelete a product
MethodEndpointDescription
GET/admin/api/products/:id/variantsList variants for a product
POST/admin/api/variantsCreate a variant
PUT/admin/api/variants/:idUpdate a variant
DELETE/admin/api/variants/:idDelete a variant
MethodEndpointDescription
GET/admin/api/variants/:id/releasesList releases for a variant
GET/admin/api/releases/:idGet release details
DELETE/admin/api/releases/:idDelete a release
MethodEndpointDescription
GET/admin/api/settingsGet platform settings
PUT/admin/api/settingsUpdate platform settings
MethodEndpointDescription
GET/admin/api/devicesList enrolled iOS devices (UDID)
DELETE/admin/api/devices/:idRemove a device
MethodEndpointDescription
GET/admin/api/eventsEvent log (uploads, downloads, errors)

The events endpoint supports pagination and filtering by event type, date range, and variant.

The admin API supports CSV export for bulk data extraction:

Terminal window
# Export all releases for a variant
curl -H "X-Auth-Token: your-api-token" \
"https://fenfa.example.com/admin/api/variants/abc123/releases?format=csv" \
-o releases.csv
# Export device list
curl -H "X-Auth-Token: your-api-token" \
"https://fenfa.example.com/admin/api/devices?format=csv" \
-o devices.csv
- name: Upload to Fenfa
run: |
curl -X POST ${{ secrets.FENFA_URL }}/upload \
-H "X-Auth-Token: ${{ secrets.FENFA_TOKEN }}" \
-F "variant_id=${{ vars.FENFA_VARIANT_ID }}" \
-F "app_file=@build/output/MyApp.apk" \
-F "version=${{ github.ref_name }}" \
-F "build=${{ github.run_number }}" \
-F "changelog=$(git log --oneline -5)"