Description: Fetches ad content. Requires active session and authorization. Returns ad data you'll need to display.
Request Body:
gameUuid
: string (required) - The unique identifier of the game.sauthToken
: string (required) - The authorization token for the request.Request Example:
{
"gameUuid": "32bde2de-d225-448f-8c6a-263275d93ef2",
"authToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}
Response:
ad
: object - The selected advertisement.
id
: number - Unique identifier of the ad.title
: string - The title of the ad.description
: string - A brief description of the ad.type
: string - The type of the ad.campaign
: number - The associated campaign's ID.url
: string - The URL to the ad's content.media
: string - The URL to the ad image.isActive
: boolean - Whether the ad is currently active.Response Example:
{
"ad": {
"id": 123,
"title": "New Season Sale!",
"description": "Get up to 50% off on all items.",
"type": "banner",
"campaign": 456,
"url": "<https://example.com/ad/123>",
"isActive": true,
"media": "<https://example.com/ad/123.png>"
}
}
Error Responses:
400 Bad Request
:
error.code
: INVALID_IDENTIFIER
error.message
: Invalid game identifier. Get one on the game page.
401 Not Authorized
:
error.code
: PREMIUM_USER
error.message
: You cannot request an ad for a premium user.
400 Bad Request
:
error.code
: NO_ACTIVE_SESSION
error.message
: No active session
400 Bad Request
:
error.code
: INVALID_TOKEN
error.message
: Invalid token.
408 Request Timeout
:
error.code
: ERR_TIMEOUT
error.message
: Try again later.
404 Not Found
:
error.code
: NO_ACTIVE_CAMPAIGNS
error.message
: No active campaigns available.
404 Not Found
:
error.code
: NO_ACTIVE_ADS
error.message
: No active ads available.
500 Internal Server Error
:
error.code
: ISE
error.message
: Internal Server Error