Rename photobooth upload endpoint
This commit is contained in:
@@ -33,7 +33,7 @@ class PhotoboothConnectController extends Controller
|
||||
|
||||
return response()->json([
|
||||
'data' => [
|
||||
'upload_url' => route('api.v1.photobooth.sparkbooth.upload'),
|
||||
'upload_url' => route('api.v1.photobooth.upload'),
|
||||
'username' => $setting->username,
|
||||
'password' => $setting->password,
|
||||
'expires_at' => optional($setting->expires_at)->toIso8601String(),
|
||||
|
||||
@@ -47,7 +47,7 @@ class PhotoboothStatusResource extends JsonResource
|
||||
'password' => $password,
|
||||
'path' => $eventSetting?->path,
|
||||
'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(),
|
||||
'rate_limit_per_minute' => (int) $settings->rate_limit_per_minute,
|
||||
'ftp' => [
|
||||
@@ -62,7 +62,7 @@ class PhotoboothStatusResource extends JsonResource
|
||||
'username' => $mode === 'sparkbooth' ? $eventSetting?->username : null,
|
||||
'password' => $mode === 'sparkbooth' ? $password : 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'),
|
||||
'metrics' => $sparkMetrics,
|
||||
],
|
||||
|
||||
@@ -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.
|
||||
|
||||
- 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”).
|
||||
- Body (multipart/form-data): `media` (file or base64), `username`, `password`, optionally `name`, `email`, `message`.
|
||||
- Response:
|
||||
@@ -99,7 +99,7 @@ Use this when Sparkbooth runs in “Custom Upload” mode instead of FTP.
|
||||
Example cURL (JSON response):
|
||||
|
||||
```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 "username=PB123" \
|
||||
-F "password=SECRET" \
|
||||
@@ -109,7 +109,7 @@ curl -X POST https://app.example.com/api/v1/photobooth/sparkbooth/upload \
|
||||
Example cURL (request XML response):
|
||||
|
||||
```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 "username=PB123" \
|
||||
-F "password=SECRET" \
|
||||
|
||||
@@ -153,8 +153,8 @@ Route::prefix('v1')->name('api.v1.')->group(function () {
|
||||
->middleware('signed')
|
||||
->name('gallery.photos.asset');
|
||||
|
||||
Route::post('/photobooth/sparkbooth/upload', [SparkboothUploadController::class, 'store'])
|
||||
->name('photobooth.sparkbooth.upload');
|
||||
Route::post('/photobooth/upload', [SparkboothUploadController::class, 'store'])
|
||||
->name('photobooth.upload');
|
||||
Route::post('/photobooth/connect', [PhotoboothConnectController::class, 'store'])
|
||||
->middleware('throttle:photobooth-connect')
|
||||
->name('photobooth.connect');
|
||||
|
||||
Reference in New Issue
Block a user