400
invalid_requestThe request did not satisfy the documented contract.
Beladed Embeds API
Create through the reviewed Beladed Embeds contract.
/api/vote/embed/createcurl --request POST 'https://api.beladed.dev/api/vote/embed/create' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'X-Beladed-API-Key: BELADED_SECRET_KEY' \
--data '{
"idempotencyKey": "example_idempotencykey",
"name": "Website Audience Pulse",
"title": "Website Audience Pulse",
"description": "Measure audience response directly on your website.",
"domain": "example_domain",
"targetUrl": "https://merchant.example.invalid",
"selector": "#beladed-vote-widget",
"placement": "inline",
"brandName": "Beladed",
"primaryColor": "#2563EB",
"secondaryColor": "#111827",
"revShareEnabled": false,
"allowAnonymous": true,
"showBranding": true,
"status": "draft",
"options": [
{
"id": "id_demo_001",
"text": "Love It",
"color": "#16A34A"
},
{
"id": "id_demo_001",
"text": "Need More Info",
"color": "#F59E0B"
}
],
"config": {
"placement": "inline",
"selector": "#beladed-vote-widget"
}
}'const response = await fetch("https://api.beladed.dev/api/vote/embed/create", {
method: "POST",
headers: {
"Accept": "application/json",
"Content-Type": "application/json",
"X-Beladed-API-Key": "BELADED_SECRET_KEY"
},
body: JSON.stringify({
"idempotencyKey": "example_idempotencykey",
"name": "Website Audience Pulse",
"title": "Website Audience Pulse",
"description": "Measure audience response directly on your website.",
"domain": "example_domain",
"targetUrl": "https://merchant.example.invalid",
"selector": "#beladed-vote-widget",
"placement": "inline",
"brandName": "Beladed",
"primaryColor": "#2563EB",
"secondaryColor": "#111827",
"revShareEnabled": false,
"allowAnonymous": true,
"showBranding": true,
"status": "draft",
"options": [
{
"id": "id_demo_001",
"text": "Love It",
"color": "#16A34A"
},
{
"id": "id_demo_001",
"text": "Need More Info",
"color": "#F59E0B"
}
],
"config": {
"placement": "inline",
"selector": "#beladed-vote-widget"
}
})
});
if (!response.ok) throw new Error(`Beladed request failed: ${response.status}`);
const responseText = await response.text();
const data = responseText ? JSON.parse(responseText) : null;import json
import requests
response = requests.request(
"POST",
"https://api.beladed.dev/api/vote/embed/create",
headers={"Accept":"application/json","Content-Type":"application/json","X-Beladed-API-Key":"BELADED_SECRET_KEY"},
json=json.loads("{\n \"idempotencyKey\": \"example_idempotencykey\",\n \"name\": \"Website Audience Pulse\",\n \"title\": \"Website Audience Pulse\",\n \"description\": \"Measure audience response directly on your website.\",\n \"domain\": \"example_domain\",\n \"targetUrl\": \"https://merchant.example.invalid\",\n \"selector\": \"#beladed-vote-widget\",\n \"placement\": \"inline\",\n \"brandName\": \"Beladed\",\n \"primaryColor\": \"#2563EB\",\n \"secondaryColor\": \"#111827\",\n \"revShareEnabled\": false,\n \"allowAnonymous\": true,\n \"showBranding\": true,\n \"status\": \"draft\",\n \"options\": [\n {\n \"id\": \"id_demo_001\",\n \"text\": \"Love It\",\n \"color\": \"#16A34A\"\n },\n {\n \"id\": \"id_demo_001\",\n \"text\": \"Need More Info\",\n \"color\": \"#F59E0B\"\n }\n ],\n \"config\": {\n \"placement\": \"inline\",\n \"selector\": \"#beladed-vote-widget\"\n }\n}"),
timeout=30,
)
response.raise_for_status()
data = response.json()<?php
$client = curl_init('https://api.beladed.dev/api/vote/embed/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 => '{
"idempotencyKey": "example_idempotencykey",
"name": "Website Audience Pulse",
"title": "Website Audience Pulse",
"description": "Measure audience response directly on your website.",
"domain": "example_domain",
"targetUrl": "https://merchant.example.invalid",
"selector": "#beladed-vote-widget",
"placement": "inline",
"brandName": "Beladed",
"primaryColor": "#2563EB",
"secondaryColor": "#111827",
"revShareEnabled": false,
"allowAnonymous": true,
"showBranding": true,
"status": "draft",
"options": [
{
"id": "id_demo_001",
"text": "Love It",
"color": "#16A34A"
},
{
"id": "id_demo_001",
"text": "Need More Info",
"color": "#F59E0B"
}
],
"config": {
"placement": "inline",
"selector": "#beladed-vote-widget"
}
}',
]);
$response = curl_exec($client);
if ($response === false) throw new RuntimeException(curl_error($client));
curl_close($client);
$data = $response === "" ? null : json_decode($response, true, 512, JSON_THROW_ON_ERROR);require "net/http"
require "json"
uri = URI('https://api.beladed.dev/api/vote/embed/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 = '{
"idempotencyKey": "example_idempotencykey",
"name": "Website Audience Pulse",
"title": "Website Audience Pulse",
"description": "Measure audience response directly on your website.",
"domain": "example_domain",
"targetUrl": "https://merchant.example.invalid",
"selector": "#beladed-vote-widget",
"placement": "inline",
"brandName": "Beladed",
"primaryColor": "#2563EB",
"secondaryColor": "#111827",
"revShareEnabled": false,
"allowAnonymous": true,
"showBranding": true,
"status": "draft",
"options": [
{
"id": "id_demo_001",
"text": "Love It",
"color": "#16A34A"
},
{
"id": "id_demo_001",
"text": "Need More Info",
"color": "#F59E0B"
}
],
"config": {
"placement": "inline",
"selector": "#beladed-vote-widget"
}
}'
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(request) }
raise "Beladed request failed: #{response.code}" unless response.is_a?(Net::HTTPSuccess)
data = response.body.empty? ? nil : JSON.parse(response.body)public class BeladedExample {
public static void main(String[] args) throws Exception {
var request = java.net.http.HttpRequest.newBuilder()
.uri(java.net.URI.create("https://api.beladed.dev/api/vote/embed/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 \"idempotencyKey\": \"example_idempotencykey\",\n \"name\": \"Website Audience Pulse\",\n \"title\": \"Website Audience Pulse\",\n \"description\": \"Measure audience response directly on your website.\",\n \"domain\": \"example_domain\",\n \"targetUrl\": \"https://merchant.example.invalid\",\n \"selector\": \"#beladed-vote-widget\",\n \"placement\": \"inline\",\n \"brandName\": \"Beladed\",\n \"primaryColor\": \"#2563EB\",\n \"secondaryColor\": \"#111827\",\n \"revShareEnabled\": false,\n \"allowAnonymous\": true,\n \"showBranding\": true,\n \"status\": \"draft\",\n \"options\": [\n {\n \"id\": \"id_demo_001\",\n \"text\": \"Love It\",\n \"color\": \"#16A34A\"\n },\n {\n \"id\": \"id_demo_001\",\n \"text\": \"Need More Info\",\n \"color\": \"#F59E0B\"\n }\n ],\n \"config\": {\n \"placement\": \"inline\",\n \"selector\": \"#beladed-vote-widget\"\n }\n}"))
.build();
var response = java.net.http.HttpClient.newHttpClient().send(request, java.net.http.HttpResponse.BodyHandlers.ofString());
if (response.statusCode() >= 400) throw new IllegalStateException("Beladed request failed: " + response.statusCode());
var responseJson = response.body();
System.out.println(responseJson);
}
}package main
import (
"bytes"
"encoding/json"
"fmt"
"io"
"net/http"
)
func callBeladed() (any, error) {
body := []byte("{\n \"idempotencyKey\": \"example_idempotencykey\",\n \"name\": \"Website Audience Pulse\",\n \"title\": \"Website Audience Pulse\",\n \"description\": \"Measure audience response directly on your website.\",\n \"domain\": \"example_domain\",\n \"targetUrl\": \"https://merchant.example.invalid\",\n \"selector\": \"#beladed-vote-widget\",\n \"placement\": \"inline\",\n \"brandName\": \"Beladed\",\n \"primaryColor\": \"#2563EB\",\n \"secondaryColor\": \"#111827\",\n \"revShareEnabled\": false,\n \"allowAnonymous\": true,\n \"showBranding\": true,\n \"status\": \"draft\",\n \"options\": [\n {\n \"id\": \"id_demo_001\",\n \"text\": \"Love It\",\n \"color\": \"#16A34A\"\n },\n {\n \"id\": \"id_demo_001\",\n \"text\": \"Need More Info\",\n \"color\": \"#F59E0B\"\n }\n ],\n \"config\": {\n \"placement\": \"inline\",\n \"selector\": \"#beladed-vote-widget\"\n }\n}")
request, err := http.NewRequest("POST", "https://api.beladed.dev/api/vote/embed/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")
response, err := http.DefaultClient.Do(request)
if err != nil { return nil, err }
defer response.Body.Close()
if response.StatusCode >= 400 { return nil, fmt.Errorf("Beladed request failed: %s", response.Status) }
var data any
if err := json.NewDecoder(response.Body).Decode(&data); err != nil && err != io.EOF { return nil, err }
return data, nil
}
func main() {
data, err := callBeladed()
if err != nil { panic(err) }
fmt.Printf("%#v\n", data)
}using System.Net.Http;
using var client = new HttpClient();
using var request = new HttpRequestMessage(new HttpMethod("POST"), "https://api.beladed.dev/api/vote/embed/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 \"idempotencyKey\": \"example_idempotencykey\",\n \"name\": \"Website Audience Pulse\",\n \"title\": \"Website Audience Pulse\",\n \"description\": \"Measure audience response directly on your website.\",\n \"domain\": \"example_domain\",\n \"targetUrl\": \"https://merchant.example.invalid\",\n \"selector\": \"#beladed-vote-widget\",\n \"placement\": \"inline\",\n \"brandName\": \"Beladed\",\n \"primaryColor\": \"#2563EB\",\n \"secondaryColor\": \"#111827\",\n \"revShareEnabled\": false,\n \"allowAnonymous\": true,\n \"showBranding\": true,\n \"status\": \"draft\",\n \"options\": [\n {\n \"id\": \"id_demo_001\",\n \"text\": \"Love It\",\n \"color\": \"#16A34A\"\n },\n {\n \"id\": \"id_demo_001\",\n \"text\": \"Need More Info\",\n \"color\": \"#F59E0B\"\n }\n ],\n \"config\": {\n \"placement\": \"inline\",\n \"selector\": \"#beladed-vote-widget\"\n }\n}", System.Text.Encoding.UTF8, "application/json");
using var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
var responseBody = await response.Content.ReadAsStringAsync();
using var data = System.Text.Json.JsonDocument.Parse(string.IsNullOrWhiteSpace(responseBody) ? "null" : responseBody);import Foundation
var request = URLRequest(url: URL(string: "https://api.beladed.dev/api/vote/embed/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 \"idempotencyKey\": \"example_idempotencykey\",\n \"name\": \"Website Audience Pulse\",\n \"title\": \"Website Audience Pulse\",\n \"description\": \"Measure audience response directly on your website.\",\n \"domain\": \"example_domain\",\n \"targetUrl\": \"https://merchant.example.invalid\",\n \"selector\": \"#beladed-vote-widget\",\n \"placement\": \"inline\",\n \"brandName\": \"Beladed\",\n \"primaryColor\": \"#2563EB\",\n \"secondaryColor\": \"#111827\",\n \"revShareEnabled\": false,\n \"allowAnonymous\": true,\n \"showBranding\": true,\n \"status\": \"draft\",\n \"options\": [\n {\n \"id\": \"id_demo_001\",\n \"text\": \"Love It\",\n \"color\": \"#16A34A\"\n },\n {\n \"id\": \"id_demo_001\",\n \"text\": \"Need More Info\",\n \"color\": \"#F59E0B\"\n }\n ],\n \"config\": {\n \"placement\": \"inline\",\n \"selector\": \"#beladed-vote-widget\"\n }\n}".data(using: .utf8)
let (data, response) = try await URLSession.shared.data(for: request)
guard let httpResponse = response as? HTTPURLResponse, (200..<300).contains(httpResponse.statusCode) else { throw URLError(.badServerResponse) }
let decoded: Any? = data.isEmpty ? nil : (try JSONSerialization.jsonObject(with: data))fun main() {
val request = okhttp3.Request.Builder()
.url("https://api.beladed.dev/api/vote/embed/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 \"idempotencyKey\": \"example_idempotencykey\",\n \"name\": \"Website Audience Pulse\",\n \"title\": \"Website Audience Pulse\",\n \"description\": \"Measure audience response directly on your website.\",\n \"domain\": \"example_domain\",\n \"targetUrl\": \"https://merchant.example.invalid\",\n \"selector\": \"#beladed-vote-widget\",\n \"placement\": \"inline\",\n \"brandName\": \"Beladed\",\n \"primaryColor\": \"#2563EB\",\n \"secondaryColor\": \"#111827\",\n \"revShareEnabled\": false,\n \"allowAnonymous\": true,\n \"showBranding\": true,\n \"status\": \"draft\",\n \"options\": [\n {\n \"id\": \"id_demo_001\",\n \"text\": \"Love It\",\n \"color\": \"#16A34A\"\n },\n {\n \"id\": \"id_demo_001\",\n \"text\": \"Need More Info\",\n \"color\": \"#F59E0B\"\n }\n ],\n \"config\": {\n \"placement\": \"inline\",\n \"selector\": \"#beladed-vote-widget\"\n }\n}"))
.build()
val responseJson = okhttp3.OkHttpClient().newCall(request).execute().use { response ->
check(response.isSuccessful) { "Beladed request failed: ${response.code}" }
response.body?.string().orEmpty()
}
println(responseJson)
}
This operation has no documented parameters.
{
"type": "object",
"properties": {
"idempotencyKey": {
"type": "string"
},
"name": {
"type": "string"
},
"title": {
"type": "string"
},
"description": {
"type": "string"
},
"domain": {
"type": "string"
},
"targetUrl": {
"type": "string"
},
"selector": {
"type": "string"
},
"placement": {
"type": "string"
},
"brandName": {
"type": "string"
},
"primaryColor": {
"type": "string"
},
"secondaryColor": {
"type": "string"
},
"revShareEnabled": {
"type": "boolean"
},
"allowAnonymous": {
"type": "boolean"
},
"showBranding": {
"type": "boolean"
},
"status": {
"type": "string"
},
"options": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"text": {
"type": "string"
},
"color": {
"type": "string"
}
}
}
},
"config": {
"type": "object",
"properties": {
"placement": {
"type": "string"
},
"selector": {
"type": "string"
}
}
}
}
}{
"idempotencyKey": "example_idempotencykey",
"name": "Website Audience Pulse",
"title": "Website Audience Pulse",
"description": "Measure audience response directly on your website.",
"domain": "example_domain",
"targetUrl": "https://merchant.example.invalid",
"selector": "#beladed-vote-widget",
"placement": "inline",
"brandName": "Beladed",
"primaryColor": "#2563EB",
"secondaryColor": "#111827",
"revShareEnabled": false,
"allowAnonymous": true,
"showBranding": true,
"status": "draft",
"options": [
{
"id": "id_demo_001",
"text": "Love It",
"color": "#16A34A"
},
{
"id": "id_demo_001",
"text": "Need More Info",
"color": "#F59E0B"
}
],
"config": {
"placement": "inline",
"selector": "#beladed-vote-widget"
}
}
{
"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 route, handler, and test contracts. Internal implementation paths remain private.