blog_image
19 Jan 2025

API Get All Ads Data Documentation

API Documentation: Get All Advertisements Data


Endpoint

POST /api/ads/data

Description

This API is used to retrieve all advertisements associated with the authenticated user.



Request Format

URL:
/api/ads/data

Method:
POST

Headers:

  • Content-Type: application/json

Body Parameters:
The request body must be in JSON format with the following fields:

  1. token (string): The authentication token for the API. This field is required.

Example Request Body:

{
    "token": "8|koJNODexEl8Kif3BW7wpiZFrrAAenbxl0fkZ6rwWb0a83fb1"
}


Response Format

Success Response:

  • status (boolean): Indicates whether the operation was successful.
  • message (string): A descriptive message about the operation.
  • data (array): Contains a list of all advertisements associated with the user.


Example Success Response:

{
    "status": true,
    "message": "Successfully get deta ads.",
    "data": [
        {
            "id": 1,
            "user_id": 15,
            "ads_type": 2,
            "title": "promo akhir tahun",
            "ads_body": "https://klik.cyberszone.com/assets/images/ptc/2025/01/13/67847913766821736734995.png",
            "amount": "46.00000000",
            "duration": 10,
            "max_show": 10,
            "showed": 0,
            "remain": 10,
            "reject_reason": null,
            "schedule": [
                {
                    "day": "sunday",
                    "start": "09:22",
                    "end": "13:22"
                }
            ],
            "status": 1,
            "created_at": "2025-01-13T02:19:52.000000Z",
            "updated_at": "2025-01-19T10:29:10.000000Z",
            "views": []
        }
    ]
}