POST /api/ads/create
This endpoint is used for submitting a new advertisement or content. It validates the input fields and processes the submission based on the provided data.
application/json
string (required)
string (optional)
file (optional)
string (optional)
string (optional)
integer (required)
string (required)
integer (required)
integer (required)
1: Website Link2: Banner Image3: Script (HTML/JS)4: YouTubeschedule: array (optional)
An array of schedules specifying when the advertisement should run. Each schedule includes:
day: string (required) - The day of the week (e.g., "sunday").
start: string (required) - The start time in HH:mm format.
end: string (required) - The end time in HH:mm format.
{
"token": "user_token_123",
"website_link": "https://example.com",
"max_show": 10,
"title": "Example Ad",
"duration": 30,
"ads_type": 1
}
Status Code: 200 OK
Body:
{
"status": true,
"message": "Content submitted successfully."
}
Status Code: 422 Unprocessable Entity
Body:
{
"errors": {
"token": ["The token field is required."],
"max_show": ["The max show must be at least 1."],
"title": ["The title field is required."],
"duration": ["The duration field is required."],
"ads_type": ["The ads type field is required."]
}
}
schedule: Optional, must be an array of objects with day, start, and end keys.