Serve ads
Returns served ads for the given placement and locale. Supports a preview mode when preview_token is provided — in that case eligibility filters are bypassed and no serve_token is minted. preview_token is a short-lived signed token minted by an authenticated merchant via the HQ CreateAdPreviewToken endpoint; the ad id is read from the token payload, never from a caller-supplied query parameter.
/v1/marketplace/ads/serveQuery Parameters
BCP-47 locale tag for the consumer's language.
"is""discovery"When set, preview mode is active — returns only the ad encoded in the token, without eligibility checks and without a serve_token.
"eyJhbGciOiJIUzI1NiJ9..."How many ads to draw for the placement. Each request is an independent random draw, so this is a plain count rather than pagination. Fewer eligible ads than requested returns what there is. Ignored in preview mode, which always returns exactly one ad.
5int321 <= value <= 5005Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X GET "https://api.noona.is/v1/marketplace/ads/serve?locale=is&placement=discovery"[
{
"id": "abc123def456",
"creative": {
"type": "image",
"image": {
"image": {
"thumb": "https://placekitten.com/200/200",
"image": "https://placekitten.com/200/300",
"type": "thumbnail",
"public_id": "https://placekitten.com/200/300"
}
},
"text_overlay": {
"image": {
"thumb": "https://placekitten.com/200/200",
"image": "https://placekitten.com/200/300",
"type": "thumbnail",
"public_id": "https://placekitten.com/200/300"
},
"overlay_text": "string"
}
},
"description": "string",
"action": {
"type": "company",
"event_type": "string",
"voucher_template": "string",
"scheduled_event": "string"
},
"company": "string",
"campaign_id": "fed654cba321",
"serve_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}
]{
"type": "generic_error",
"message": "Time slot is not available."
}{
"type": "generic_error",
"message": "Time slot is not available."
}{
"type": "generic_error",
"message": "Time slot is not available."
}{
"type": "generic_error",
"message": "Time slot is not available."
}{
"type": "generic_error",
"message": "Time slot is not available.",
"code": "preview_token_expired"
}{
"type": "generic_error",
"message": "Time slot is not available."
}