PUT
/
projects
/
{project_id}
/
ads
/
{id}
HttpResponse<String> response = Unirest.put("https://api.beyondwords.io/v1/projects/{project_id}/ads/{id}")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"custom\",\n \"enabled\": true,\n \"placement\": \"pre-roll\",\n \"vast_url\": null,\n \"title\": \"My Ad\",\n \"click_through_url\": \"https://example.com\",\n \"image_url\": \"https://example.com/image.png\",\n \"media_url\": \"https://example.com/advert.mp3\",\n \"theme\": \"dark\",\n \"dark_theme\": {\n \"text_color\": \"#fff\",\n \"background_color\": \"#333\",\n \"icon_color\": \"#ff0\"\n },\n \"light_theme\": null,\n \"time_range\": {\n \"start\": \"2023-12-01 00:00:00 UTC\",\n \"end\": \"2023-12-31 23:59:59 UTC\"\n }\n}")
.asString();
{
  "id": 1,
  "type": "custom",
  "enabled": true,
  "placement": "pre-roll",
  "vast_url": null,
  "title": "My advert title",
  "click_through_url": "https://example.com",
  "image_url": "https://example.com/image.png",
  "media_url": "https://example.com/advert.mp3",
  "media": [
    {
      "id": 123,
      "content_type": "audio/mpeg",
      "url": "https://example.com/transcoded.mp3",
      "duration": 15000
    },
    {
      "id": 124,
      "content_type": "application/vnd.apple.mpegurl",
      "url": "https://example.com/transcoded.m3u8",
      "duration": 15000
    }
  ],
  "theme": "dark",
  "dark_theme": {
    "text_color": "#fff",
    "background_color": "#333",
    "icon_color": "#ff0"
  },
  "light_theme": null,
  "video_theme": null,
  "time_range": {
    "start": "2023-12-01 00:00:00 UTC",
    "end": "2023-12-31 23:59:59 UTC"
  },
  "created": "2023-01-01 00:00:00 UTC",
  "updated": "2023-01-01 00:00:05 UTC"
}

Authorizations

X-Api-Key
string
header
required

Path Parameters

project_id
string
required

The numeric ID of your project

id
string
required

The numeric ID of your ad

Body

application/json

Update ad with custom type

Response

200 - application/json

successful

The response is of type object.