Prefetch API
Overview
The Serverside.ai prefetch API provides a solution for efficiently delivering ad sources, ensuring they are conditioned and ready for use upon request. This document describes its endpoints, request headers, request bodies, and response codes for retrieving and prefetching ad media for channels.
Get ad media for a given channel
GET https://mydomain.com/api/v2/medias
Header
| Field | Type | Description |
|---|---|---|
x-api-key* |
string | Your Serverside.ai API key |
Request body
| Field | Type | Description |
|---|---|---|
type |
string |
The kind of media being requested:
|
channelId |
string | The request for a given channel. |
Prefetch ad media condition for a given channel
PUT https://mydomain.com/api/v2/channel-assets
Headers
| Field | Type | Description |
|---|---|---|
x-api-key* |
string | Your Serverside.ai API key. |
Request Body
| Field | Type | Description |
|---|---|---|
id* |
string | The unique identifier of the ad creative. |
name* |
string | The name of the ad creative or campaign. |
source* |
string | The URL of the ad media creative. |
channelId* |
string | The ID of the channel for which the prefetch applies. |
allChannels |
boolean |
A boolean indicating if the prefetch should be applied to all configured channels.
|
200: OK Successful
400: Bad Request
{
"name": "BadRequestError",
"message": "BadRequest",
"code": 400,
"type": "Your input data is not valid."
}401: Unauthorized
{
"name": "UnAuthorizedError",
"message": "Unauthorized",
"code": 401,
"type": "Request cannot be authenticated. Check if you are transferring an API-Key or JWT in the header."
}403: Forbidden
{
"name": "ForbiddenError",
"message": "Forbidden",
"code": 403,
"type": "You have no rights to access the resorce."
}404: Not Found
{
"name": "NotFoundError",
"message": "NotFound",
"code": 404,
"type": "No such item."
}500: Internal Server Error
{
"name": "ServerError",
"message": "ServerError",
"code": 500,
"type": "Error on server side."
}