iOS — Initiate direct-to-S3 multipart upload to replace an existing slot
curl --request POST \
--url http://localhost/mogl/mogl-backend/api/deal-folder/files/{file}/replace/initiate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"file_name": "reel-v2.mp4",
"file_size": 10215040,
"file_mime_type": "video/mp4"
}
'import requests
url = "http://localhost/mogl/mogl-backend/api/deal-folder/files/{file}/replace/initiate"
payload = {
"file_name": "reel-v2.mp4",
"file_size": 10215040,
"file_mime_type": "video/mp4"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({file_name: 'reel-v2.mp4', file_size: 10215040, file_mime_type: 'video/mp4'})
};
fetch('http://localhost/mogl/mogl-backend/api/deal-folder/files/{file}/replace/initiate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "http://localhost/mogl/mogl-backend/api/deal-folder/files/{file}/replace/initiate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'file_name' => 'reel-v2.mp4',
'file_size' => 10215040,
'file_mime_type' => 'video/mp4'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "http://localhost/mogl/mogl-backend/api/deal-folder/files/{file}/replace/initiate"
payload := strings.NewReader("{\n \"file_name\": \"reel-v2.mp4\",\n \"file_size\": 10215040,\n \"file_mime_type\": \"video/mp4\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("http://localhost/mogl/mogl-backend/api/deal-folder/files/{file}/replace/initiate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"file_name\": \"reel-v2.mp4\",\n \"file_size\": 10215040,\n \"file_mime_type\": \"video/mp4\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost/mogl/mogl-backend/api/deal-folder/files/{file}/replace/initiate")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"file_name\": \"reel-v2.mp4\",\n \"file_size\": 10215040,\n \"file_mime_type\": \"video/mp4\"\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"data": {
"session_id": 512,
"upload_id": "2~xyzABC987defGHI654jklMNO321pqrSTU0",
"s3_key": "deal-folders/12/slot-1/v2/reel-v2.mp4",
"parts": [
{
"part_number": 1,
"presigned_url": "https://mogl-prod.s3.amazonaws.com/deal-folders/12/slot-1/v2/reel-v2.mp4?partNumber=1&uploadId=2~xyz...&X-Amz-Signature=..."
}
]
}
}{
"message": "Unauthenticated."
}{
"status": "error",
"message": "Deal folder file not found."
}{
"message": "The given data was invalid.",
"errors": {}
}iOS — Initiate direct-to-S3 multipart upload to replace an existing slot
iOS-only. Step 1 of 2 for replacing an existing file slot. Creates an S3 multipart upload session bound to this DealFolderFile and returns presigned URLs (one per ~10 MB part) valid for 24 hours. Call POST /deal-folder/files//replace/complete with the returned session_id and per-part ETags to finalise. Only the original uploader (or the athlete’s agent) may call this; voided slots cannot be replaced.
POST
/
deal-folder
/
files
/
{file}
/
replace
/
initiate
iOS — Initiate direct-to-S3 multipart upload to replace an existing slot
curl --request POST \
--url http://localhost/mogl/mogl-backend/api/deal-folder/files/{file}/replace/initiate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"file_name": "reel-v2.mp4",
"file_size": 10215040,
"file_mime_type": "video/mp4"
}
'import requests
url = "http://localhost/mogl/mogl-backend/api/deal-folder/files/{file}/replace/initiate"
payload = {
"file_name": "reel-v2.mp4",
"file_size": 10215040,
"file_mime_type": "video/mp4"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({file_name: 'reel-v2.mp4', file_size: 10215040, file_mime_type: 'video/mp4'})
};
fetch('http://localhost/mogl/mogl-backend/api/deal-folder/files/{file}/replace/initiate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "http://localhost/mogl/mogl-backend/api/deal-folder/files/{file}/replace/initiate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'file_name' => 'reel-v2.mp4',
'file_size' => 10215040,
'file_mime_type' => 'video/mp4'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "http://localhost/mogl/mogl-backend/api/deal-folder/files/{file}/replace/initiate"
payload := strings.NewReader("{\n \"file_name\": \"reel-v2.mp4\",\n \"file_size\": 10215040,\n \"file_mime_type\": \"video/mp4\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("http://localhost/mogl/mogl-backend/api/deal-folder/files/{file}/replace/initiate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"file_name\": \"reel-v2.mp4\",\n \"file_size\": 10215040,\n \"file_mime_type\": \"video/mp4\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost/mogl/mogl-backend/api/deal-folder/files/{file}/replace/initiate")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"file_name\": \"reel-v2.mp4\",\n \"file_size\": 10215040,\n \"file_mime_type\": \"video/mp4\"\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"data": {
"session_id": 512,
"upload_id": "2~xyzABC987defGHI654jklMNO321pqrSTU0",
"s3_key": "deal-folders/12/slot-1/v2/reel-v2.mp4",
"parts": [
{
"part_number": 1,
"presigned_url": "https://mogl-prod.s3.amazonaws.com/deal-folders/12/slot-1/v2/reel-v2.mp4?partNumber=1&uploadId=2~xyz...&X-Amz-Signature=..."
}
]
}
}{
"message": "Unauthenticated."
}{
"status": "error",
"message": "Deal folder file not found."
}{
"message": "The given data was invalid.",
"errors": {}
}Authorizations
JWT Bearer token authentication. Use the /api/login endpoint to obtain a token.
Path Parameters
DealFolderFile ID (slot ID).
Example:
5
Body
application/json