400
invalid_requestThe request did not satisfy the documented contract.
Beladed Ads API
Create through the reviewed Beladed Ads contract.
/api/ads/placement/createcurl --request POST 'https://api.beladed.dev/api/ads/placement/create' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'X-Beladed-API-Key: BELADED_SECRET_KEY' \
--data '{
"publisherId": "id_demo_001",
"siteId": "id_demo_001",
"inventoryId": "id_demo_001",
"adId": "id_demo_001",
"campaignId": "id_demo_001",
"placementKey": "web.corporate.page.header_banner",
"surface": "page",
"slot": "header_banner",
"format": "banner",
"type": "fixed",
"status": "active",
"position": {
"x": 0,
"y": 100,
"zone": "header"
},
"size": {
"width": 728,
"height": 90
},
"voting": {
"enabled": true,
"options": [
"like",
"dislike"
],
"displayType": "buttons"
},
"choice": {
"enabled": true,
"alternatives": [
"option_a",
"option_b"
]
}
}'const response = await fetch("https://api.beladed.dev/api/ads/placement/create", {
method: "POST",
headers: {
"Accept": "application/json",
"Content-Type": "application/json",
"X-Beladed-API-Key": "BELADED_SECRET_KEY"
},
body: JSON.stringify({
"publisherId": "id_demo_001",
"siteId": "id_demo_001",
"inventoryId": "id_demo_001",
"adId": "id_demo_001",
"campaignId": "id_demo_001",
"placementKey": "web.corporate.page.header_banner",
"surface": "page",
"slot": "header_banner",
"format": "banner",
"type": "fixed",
"status": "active",
"position": {
"x": 0,
"y": 100,
"zone": "header"
},
"size": {
"width": 728,
"height": 90
},
"voting": {
"enabled": true,
"options": [
"like",
"dislike"
],
"displayType": "buttons"
},
"choice": {
"enabled": true,
"alternatives": [
"option_a",
"option_b"
]
}
})
});
const data = await response.json();import requests
response = requests.request(
"POST",
"https://api.beladed.dev/api/ads/placement/create",
headers={"Accept":"application/json","Content-Type":"application/json","X-Beladed-API-Key":"BELADED_SECRET_KEY"},
json={
"publisherId": "id_demo_001",
"siteId": "id_demo_001",
"inventoryId": "id_demo_001",
"adId": "id_demo_001",
"campaignId": "id_demo_001",
"placementKey": "web.corporate.page.header_banner",
"surface": "page",
"slot": "header_banner",
"format": "banner",
"type": "fixed",
"status": "active",
"position": {
"x": 0,
"y": 100,
"zone": "header"
},
"size": {
"width": 728,
"height": 90
},
"voting": {
"enabled": true,
"options": [
"like",
"dislike"
],
"displayType": "buttons"
},
"choice": {
"enabled": true,
"alternatives": [
"option_a",
"option_b"
]
}
},
timeout=30,
)
response.raise_for_status()
data = response.json()<?php
$client = curl_init("https://api.beladed.dev/api/ads/placement/create");
curl_setopt_array($client, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => ["Accept: application/json","Content-Type: application/json","X-Beladed-API-Key: BELADED_SECRET_KEY"],
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POSTFIELDS => json_encode({
"publisherId": "id_demo_001",
"siteId": "id_demo_001",
"inventoryId": "id_demo_001",
"adId": "id_demo_001",
"campaignId": "id_demo_001",
"placementKey": "web.corporate.page.header_banner",
"surface": "page",
"slot": "header_banner",
"format": "banner",
"type": "fixed",
"status": "active",
"position": {
"x": 0,
"y": 100,
"zone": "header"
},
"size": {
"width": 728,
"height": 90
},
"voting": {
"enabled": true,
"options": [
"like",
"dislike"
],
"displayType": "buttons"
},
"choice": {
"enabled": true,
"alternatives": [
"option_a",
"option_b"
]
}
}),
]);
$response = curl_exec($client);require "net/http"
require "json"
uri = URI("https://api.beladed.dev/api/ads/placement/create")
request = Net::HTTP::Post.new(uri)
request["Accept"] = "application/json"
request["Content-Type"] = "application/json"
request["X-Beladed-API-Key"] = "BELADED_SECRET_KEY"
request.body = "{\n \"publisherId\": \"id_demo_001\",\n \"siteId\": \"id_demo_001\",\n \"inventoryId\": \"id_demo_001\",\n \"adId\": \"id_demo_001\",\n \"campaignId\": \"id_demo_001\",\n \"placementKey\": \"web.corporate.page.header_banner\",\n \"surface\": \"page\",\n \"slot\": \"header_banner\",\n \"format\": \"banner\",\n \"type\": \"fixed\",\n \"status\": \"active\",\n \"position\": {\n \"x\": 0,\n \"y\": 100,\n \"zone\": \"header\"\n },\n \"size\": {\n \"width\": 728,\n \"height\": 90\n },\n \"voting\": {\n \"enabled\": true,\n \"options\": [\n \"like\",\n \"dislike\"\n ],\n \"displayType\": \"buttons\"\n },\n \"choice\": {\n \"enabled\": true,\n \"alternatives\": [\n \"option_a\",\n \"option_b\"\n ]\n }\n}"
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(request) }var request = java.net.http.HttpRequest.newBuilder()
.uri(java.net.URI.create("https://api.beladed.dev/api/ads/placement/create"))
.header("Accept", "application/json")
.header("Content-Type", "application/json")
.header("X-Beladed-API-Key", "BELADED_SECRET_KEY")
.method("POST", java.net.http.HttpRequest.BodyPublishers.ofString("{\n \"publisherId\": \"id_demo_001\",\n \"siteId\": \"id_demo_001\",\n \"inventoryId\": \"id_demo_001\",\n \"adId\": \"id_demo_001\",\n \"campaignId\": \"id_demo_001\",\n \"placementKey\": \"web.corporate.page.header_banner\",\n \"surface\": \"page\",\n \"slot\": \"header_banner\",\n \"format\": \"banner\",\n \"type\": \"fixed\",\n \"status\": \"active\",\n \"position\": {\n \"x\": 0,\n \"y\": 100,\n \"zone\": \"header\"\n },\n \"size\": {\n \"width\": 728,\n \"height\": 90\n },\n \"voting\": {\n \"enabled\": true,\n \"options\": [\n \"like\",\n \"dislike\"\n ],\n \"displayType\": \"buttons\"\n },\n \"choice\": {\n \"enabled\": true,\n \"alternatives\": [\n \"option_a\",\n \"option_b\"\n ]\n }\n}"))
.build();
var response = java.net.http.HttpClient.newHttpClient().send(request, java.net.http.HttpResponse.BodyHandlers.ofString());package main
import (
"bytes"
"net/http"
)
func callBeladed() (*http.Response, error) {
body := []byte("{\n \"publisherId\": \"id_demo_001\",\n \"siteId\": \"id_demo_001\",\n \"inventoryId\": \"id_demo_001\",\n \"adId\": \"id_demo_001\",\n \"campaignId\": \"id_demo_001\",\n \"placementKey\": \"web.corporate.page.header_banner\",\n \"surface\": \"page\",\n \"slot\": \"header_banner\",\n \"format\": \"banner\",\n \"type\": \"fixed\",\n \"status\": \"active\",\n \"position\": {\n \"x\": 0,\n \"y\": 100,\n \"zone\": \"header\"\n },\n \"size\": {\n \"width\": 728,\n \"height\": 90\n },\n \"voting\": {\n \"enabled\": true,\n \"options\": [\n \"like\",\n \"dislike\"\n ],\n \"displayType\": \"buttons\"\n },\n \"choice\": {\n \"enabled\": true,\n \"alternatives\": [\n \"option_a\",\n \"option_b\"\n ]\n }\n}")
request, err := http.NewRequest("POST", "https://api.beladed.dev/api/ads/placement/create", bytes.NewReader(body))
if err != nil { return nil, err }
request.Header.Set("Accept", "application/json")
request.Header.Set("Content-Type", "application/json")
request.Header.Set("X-Beladed-API-Key", "BELADED_SECRET_KEY")
return http.DefaultClient.Do(request)
}using var client = new HttpClient();
using var request = new HttpRequestMessage(new HttpMethod("POST"), "https://api.beladed.dev/api/ads/placement/create");
request.Headers.TryAddWithoutValidation("Accept", "application/json");
request.Headers.TryAddWithoutValidation("Content-Type", "application/json");
request.Headers.TryAddWithoutValidation("X-Beladed-API-Key", "BELADED_SECRET_KEY");
request.Content = new StringContent("{\n \"publisherId\": \"id_demo_001\",\n \"siteId\": \"id_demo_001\",\n \"inventoryId\": \"id_demo_001\",\n \"adId\": \"id_demo_001\",\n \"campaignId\": \"id_demo_001\",\n \"placementKey\": \"web.corporate.page.header_banner\",\n \"surface\": \"page\",\n \"slot\": \"header_banner\",\n \"format\": \"banner\",\n \"type\": \"fixed\",\n \"status\": \"active\",\n \"position\": {\n \"x\": 0,\n \"y\": 100,\n \"zone\": \"header\"\n },\n \"size\": {\n \"width\": 728,\n \"height\": 90\n },\n \"voting\": {\n \"enabled\": true,\n \"options\": [\n \"like\",\n \"dislike\"\n ],\n \"displayType\": \"buttons\"\n },\n \"choice\": {\n \"enabled\": true,\n \"alternatives\": [\n \"option_a\",\n \"option_b\"\n ]\n }\n}", System.Text.Encoding.UTF8, "application/json");
using var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();var request = URLRequest(url: URL(string: "https://api.beladed.dev/api/ads/placement/create")!)
request.httpMethod = "POST"
request.setValue("application/json", forHTTPHeaderField: "Accept")
request.setValue("application/json", forHTTPHeaderField: "Content-Type")
request.setValue("BELADED_SECRET_KEY", forHTTPHeaderField: "X-Beladed-API-Key")
request.httpBody = "{\n \"publisherId\": \"id_demo_001\",\n \"siteId\": \"id_demo_001\",\n \"inventoryId\": \"id_demo_001\",\n \"adId\": \"id_demo_001\",\n \"campaignId\": \"id_demo_001\",\n \"placementKey\": \"web.corporate.page.header_banner\",\n \"surface\": \"page\",\n \"slot\": \"header_banner\",\n \"format\": \"banner\",\n \"type\": \"fixed\",\n \"status\": \"active\",\n \"position\": {\n \"x\": 0,\n \"y\": 100,\n \"zone\": \"header\"\n },\n \"size\": {\n \"width\": 728,\n \"height\": 90\n },\n \"voting\": {\n \"enabled\": true,\n \"options\": [\n \"like\",\n \"dislike\"\n ],\n \"displayType\": \"buttons\"\n },\n \"choice\": {\n \"enabled\": true,\n \"alternatives\": [\n \"option_a\",\n \"option_b\"\n ]\n }\n}".data(using: .utf8)
let (data, response) = try await URLSession.shared.data(for: request)val request = okhttp3.Request.Builder()
.url("https://api.beladed.dev/api/ads/placement/create")
.addHeader("Accept", "application/json")
.addHeader("Content-Type", "application/json")
.addHeader("X-Beladed-API-Key", "BELADED_SECRET_KEY")
.method("POST", okhttp3.RequestBody.create(okhttp3.MediaType.get("application/json"), "{\n \"publisherId\": \"id_demo_001\",\n \"siteId\": \"id_demo_001\",\n \"inventoryId\": \"id_demo_001\",\n \"adId\": \"id_demo_001\",\n \"campaignId\": \"id_demo_001\",\n \"placementKey\": \"web.corporate.page.header_banner\",\n \"surface\": \"page\",\n \"slot\": \"header_banner\",\n \"format\": \"banner\",\n \"type\": \"fixed\",\n \"status\": \"active\",\n \"position\": {\n \"x\": 0,\n \"y\": 100,\n \"zone\": \"header\"\n },\n \"size\": {\n \"width\": 728,\n \"height\": 90\n },\n \"voting\": {\n \"enabled\": true,\n \"options\": [\n \"like\",\n \"dislike\"\n ],\n \"displayType\": \"buttons\"\n },\n \"choice\": {\n \"enabled\": true,\n \"alternatives\": [\n \"option_a\",\n \"option_b\"\n ]\n }\n}"))
.build()
val response = okhttp3.OkHttpClient().newCall(request).execute()
This operation has no documented parameters.
{
"type": "object",
"properties": {
"publisherId": {
"type": "string"
},
"siteId": {
"type": "string"
},
"inventoryId": {
"type": "string"
},
"adId": {
"type": "string"
},
"campaignId": {
"type": "string"
},
"placementKey": {
"type": "string"
},
"surface": {
"type": "string"
},
"slot": {
"type": "string"
},
"format": {
"type": "string"
},
"type": {
"type": "string"
},
"status": {
"type": "string"
},
"position": {
"type": "object",
"properties": {
"x": {
"type": "integer"
},
"y": {
"type": "integer"
},
"zone": {
"type": "string"
}
}
},
"size": {
"type": "object",
"properties": {
"width": {
"type": "integer"
},
"height": {
"type": "integer"
}
}
},
"voting": {
"type": "object",
"properties": {
"enabled": {
"type": "boolean"
},
"options": {
"type": "array",
"items": {
"type": "string"
}
},
"displayType": {
"type": "string"
}
}
},
"choice": {
"type": "object",
"properties": {
"enabled": {
"type": "boolean"
},
"alternatives": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
}
}{
"publisherId": "id_demo_001",
"siteId": "id_demo_001",
"inventoryId": "id_demo_001",
"adId": "id_demo_001",
"campaignId": "id_demo_001",
"placementKey": "web.corporate.page.header_banner",
"surface": "page",
"slot": "header_banner",
"format": "banner",
"type": "fixed",
"status": "active",
"position": {
"x": 0,
"y": 100,
"zone": "header"
},
"size": {
"width": 728,
"height": 90
},
"voting": {
"enabled": true,
"options": [
"like",
"dislike"
],
"displayType": "buttons"
},
"choice": {
"enabled": true,
"alternatives": [
"option_a",
"option_b"
]
}
}
{
"type": "object",
"properties": {
"data": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"status": {
"type": "string"
}
}
},
"requestId": {
"type": "string"
}
}
}{
"data": {
"id": "id_demo_001",
"status": "available"
},
"requestId": "req_demo_001"
}
invalid_requestThe request did not satisfy the documented contract.
authentication_requiredThe credential is missing or invalid.
not_authorizedThe account, product scope, permission, or origin is not eligible.
not_foundThe requested public or account-owned resource was not found.
rate_limitedRetry after the current product limit resets.
This operation is published from reviewed repository contracts. Source metadata is included for traceability without exposing internal implementation details.