Rename photobooth upload endpoint
Some checks failed
linter / quality (push) Has been cancelled
tests / ci (push) Has been cancelled
tests / ui (push) Has been cancelled

This commit is contained in:
Codex Agent
2026-01-12 20:05:09 +01:00
parent 93bed358ba
commit e52720a3cb
4 changed files with 8 additions and 8 deletions

View File

@@ -33,7 +33,7 @@ class PhotoboothConnectController extends Controller
return response()->json([ return response()->json([
'data' => [ 'data' => [
'upload_url' => route('api.v1.photobooth.sparkbooth.upload'), 'upload_url' => route('api.v1.photobooth.upload'),
'username' => $setting->username, 'username' => $setting->username,
'password' => $setting->password, 'password' => $setting->password,
'expires_at' => optional($setting->expires_at)->toIso8601String(), 'expires_at' => optional($setting->expires_at)->toIso8601String(),

View File

@@ -47,7 +47,7 @@ class PhotoboothStatusResource extends JsonResource
'password' => $password, 'password' => $password,
'path' => $eventSetting?->path, 'path' => $eventSetting?->path,
'ftp_url' => $isSparkbooth ? null : $this->buildFtpUrl($eventSetting, $settings, $password), 'ftp_url' => $isSparkbooth ? null : $this->buildFtpUrl($eventSetting, $settings, $password),
'upload_url' => $isSparkbooth ? route('api.v1.photobooth.sparkbooth.upload') : null, 'upload_url' => $isSparkbooth ? route('api.v1.photobooth.upload') : null,
'expires_at' => optional($activeExpires)->toIso8601String(), 'expires_at' => optional($activeExpires)->toIso8601String(),
'rate_limit_per_minute' => (int) $settings->rate_limit_per_minute, 'rate_limit_per_minute' => (int) $settings->rate_limit_per_minute,
'ftp' => [ 'ftp' => [
@@ -62,7 +62,7 @@ class PhotoboothStatusResource extends JsonResource
'username' => $mode === 'sparkbooth' ? $eventSetting?->username : null, 'username' => $mode === 'sparkbooth' ? $eventSetting?->username : null,
'password' => $mode === 'sparkbooth' ? $password : null, 'password' => $mode === 'sparkbooth' ? $password : null,
'expires_at' => $mode === 'sparkbooth' ? optional($eventSetting?->expires_at)->toIso8601String() : null, 'expires_at' => $mode === 'sparkbooth' ? optional($eventSetting?->expires_at)->toIso8601String() : null,
'upload_url' => route('api.v1.photobooth.sparkbooth.upload'), 'upload_url' => route('api.v1.photobooth.upload'),
'response_format' => ($eventSetting?->metadata ?? [])['sparkbooth_response_format'] ?? config('photobooth.sparkbooth.response_format', 'json'), 'response_format' => ($eventSetting?->metadata ?? [])['sparkbooth_response_format'] ?? config('photobooth.sparkbooth.response_format', 'json'),
'metrics' => $sparkMetrics, 'metrics' => $sparkMetrics,
], ],

View File

@@ -84,7 +84,7 @@ php artisan photobooth:ingest --event=123 --max-files=20
Use this when Sparkbooth runs in “Custom Upload” mode instead of FTP. Use this when Sparkbooth runs in “Custom Upload” mode instead of FTP.
- Endpoint: `POST /api/v1/photobooth/sparkbooth/upload` - Endpoint: `POST /api/v1/photobooth/upload`
- Auth: per-event username/password (set in Event Admin → Fotobox-Uploads; switch mode to “Sparkbooth”). - Auth: per-event username/password (set in Event Admin → Fotobox-Uploads; switch mode to “Sparkbooth”).
- Body (multipart/form-data): `media` (file or base64), `username`, `password`, optionally `name`, `email`, `message`. - Body (multipart/form-data): `media` (file or base64), `username`, `password`, optionally `name`, `email`, `message`.
- Response: - Response:
@@ -99,7 +99,7 @@ Use this when Sparkbooth runs in “Custom Upload” mode instead of FTP.
Example cURL (JSON response): Example cURL (JSON response):
```bash ```bash
curl -X POST https://app.example.com/api/v1/photobooth/sparkbooth/upload \ curl -X POST https://app.example.com/api/v1/photobooth/upload \
-F "media=@/path/to/photo.jpg" \ -F "media=@/path/to/photo.jpg" \
-F "username=PB123" \ -F "username=PB123" \
-F "password=SECRET" \ -F "password=SECRET" \
@@ -109,7 +109,7 @@ curl -X POST https://app.example.com/api/v1/photobooth/sparkbooth/upload \
Example cURL (request XML response): Example cURL (request XML response):
```bash ```bash
curl -X POST https://app.example.com/api/v1/photobooth/sparkbooth/upload \ curl -X POST https://app.example.com/api/v1/photobooth/upload \
-F "media=@/path/to/photo.jpg" \ -F "media=@/path/to/photo.jpg" \
-F "username=PB123" \ -F "username=PB123" \
-F "password=SECRET" \ -F "password=SECRET" \

View File

@@ -153,8 +153,8 @@ Route::prefix('v1')->name('api.v1.')->group(function () {
->middleware('signed') ->middleware('signed')
->name('gallery.photos.asset'); ->name('gallery.photos.asset');
Route::post('/photobooth/sparkbooth/upload', [SparkboothUploadController::class, 'store']) Route::post('/photobooth/upload', [SparkboothUploadController::class, 'store'])
->name('photobooth.sparkbooth.upload'); ->name('photobooth.upload');
Route::post('/photobooth/connect', [PhotoboothConnectController::class, 'store']) Route::post('/photobooth/connect', [PhotoboothConnectController::class, 'store'])
->middleware('throttle:photobooth-connect') ->middleware('throttle:photobooth-connect')
->name('photobooth.connect'); ->name('photobooth.connect');