blog_image
18 Jan 2025

API Update Ads Documentation

API Documentation: update ads


Endpoint

POST /api/ads/update


Description

This endpoint is used for submitting a update advertisement or content. It validates the input fields and processes the submission based on the provided data.



Request


Headers

  • Content-Type: application/json

Body Parameters

  • token: string (required)
    • The user’s unique token for authentication.
    • ads_idinteger (required)
      • The ads ID you will change the data for.

    • Add this parameters if you want to change the data
  • website_link: string
    • A URL to the website. if ads type website link.
  • banner_image: file
    • An image file (jpeg, jpg, png, gif). if ads type banner image.youtube
  • script: string
    • A script code. if ads type script.
  • youtube: string
    • A YouTube video URL. if ads type youtube.
  • max_show: integer
    • The maximum number of times the content can be shown. Must be at least 1.
  • title: string
    • The title of the advertisement or content.
  • duration: integer
    • The duration of the advertisement in seconds.
  • schedule: array
    • 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.

Example Request

{
    "token": "8|koJNODexEl8Kif3BW7wpiZFrrAAenbxl0fkZ6rwWb0a83fb1",
    "ads_id": 2,
     "website_link": "https://example.com",
"max_show": 10, "title": "Example Ad", "duration": 30, "ads_type": 1, "schedule": [ { "day": "sunday", "start": "15:56", "end": "15:57" } ] }

Response

Success Response

Status Code: 200 OK

Body:

{
    "status": true,
    "message": "Content submitted successfully."
}