Updates an ad in a project
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"
}
The numeric ID of your project
The numeric ID of your ad
Update ad with custom type
Update ad with custom type
Update ad with vast type
successful
The response is of type object
.
Was this page helpful?
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"
}