curl --request PUT \
--url https://api.hakumedia.ai/v2/schedules/{id} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"day_cap_limit": 1111,
"day_cap_type": "clicks",
"delivery_method": "default",
"start_date": "2018-09-15 00:00:00",
"end_date": "2019-10-15 00:00:00",
"start_at": "2024-11-01T09:00:00-04:00",
"start_at_timezone": "America/New_York",
"end_at": "2024-11-15T17:00:00-04:00",
"end_at_timezone": "America/New_York",
"per_user_view_limit": null,
"per_user_view_period": null,
"quota_lifetime": 10000,
"quota_type": "views",
"under_delivery_behaviour": "endOnDate",
"day_parting_id": 1234,
"status": "active"
}
'const options = {
method: 'PUT',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
day_cap_limit: 1111,
day_cap_type: 'clicks',
delivery_method: 'default',
start_date: '2018-09-15 00:00:00',
end_date: '2019-10-15 00:00:00',
start_at: '2024-11-01T09:00:00-04:00',
start_at_timezone: 'America/New_York',
end_at: '2024-11-15T17:00:00-04:00',
end_at_timezone: 'America/New_York',
per_user_view_limit: null,
per_user_view_period: null,
quota_lifetime: 10000,
quota_type: 'views',
under_delivery_behaviour: 'endOnDate',
day_parting_id: 1234,
status: 'active'
})
};
fetch('https://api.hakumedia.ai/v2/schedules/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.hakumedia.ai/v2/schedules/{id}"
payload = {
"day_cap_limit": 1111,
"day_cap_type": "clicks",
"delivery_method": "default",
"start_date": "2018-09-15 00:00:00",
"end_date": "2019-10-15 00:00:00",
"start_at": "2024-11-01T09:00:00-04:00",
"start_at_timezone": "America/New_York",
"end_at": "2024-11-15T17:00:00-04:00",
"end_at_timezone": "America/New_York",
"per_user_view_limit": None,
"per_user_view_period": None,
"quota_lifetime": 10000,
"quota_type": "views",
"under_delivery_behaviour": "endOnDate",
"day_parting_id": 1234,
"status": "active"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.hakumedia.ai/v2/schedules/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'day_cap_limit' => 1111,
'day_cap_type' => 'clicks',
'delivery_method' => 'default',
'start_date' => '2018-09-15 00:00:00',
'end_date' => '2019-10-15 00:00:00',
'start_at' => '2024-11-01T09:00:00-04:00',
'start_at_timezone' => 'America/New_York',
'end_at' => '2024-11-15T17:00:00-04:00',
'end_at_timezone' => 'America/New_York',
'per_user_view_limit' => null,
'per_user_view_period' => null,
'quota_lifetime' => 10000,
'quota_type' => 'views',
'under_delivery_behaviour' => 'endOnDate',
'day_parting_id' => 1234,
'status' => 'active'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"day_cap_limit": 1111,
"day_cap_type": "clicks",
"delivery_method": "default",
"start_date": "2018-09-15 00:00:00",
"end_date": "2019-10-15 00:00:00",
"start_at": "2024-11-01T09:00:00-04:00",
"start_at_timezone": "America/New_York",
"end_at": "2024-11-15T17:00:00-04:00",
"end_at_timezone": "America/New_York",
"per_user_view_limit": null,
"per_user_view_period": null,
"quota_lifetime": 10000,
"quota_type": "views",
"under_delivery_behaviour": "endOnDate",
"day_parting_id": 1234,
"status": "active",
"created_date": "2019-01-22 00:00:00",
"clicks": 0,
"views": 0,
"quote_remaining": null,
"object": "schedule",
"self": "/v2/schedules/1234",
"id": 1234,
"end_date_local": "2019-05-26 15:32:06",
"start_date_local": "2019-05-26 15:32:06"
}Update a Schedule
curl --request PUT \
--url https://api.hakumedia.ai/v2/schedules/{id} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"day_cap_limit": 1111,
"day_cap_type": "clicks",
"delivery_method": "default",
"start_date": "2018-09-15 00:00:00",
"end_date": "2019-10-15 00:00:00",
"start_at": "2024-11-01T09:00:00-04:00",
"start_at_timezone": "America/New_York",
"end_at": "2024-11-15T17:00:00-04:00",
"end_at_timezone": "America/New_York",
"per_user_view_limit": null,
"per_user_view_period": null,
"quota_lifetime": 10000,
"quota_type": "views",
"under_delivery_behaviour": "endOnDate",
"day_parting_id": 1234,
"status": "active"
}
'const options = {
method: 'PUT',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
day_cap_limit: 1111,
day_cap_type: 'clicks',
delivery_method: 'default',
start_date: '2018-09-15 00:00:00',
end_date: '2019-10-15 00:00:00',
start_at: '2024-11-01T09:00:00-04:00',
start_at_timezone: 'America/New_York',
end_at: '2024-11-15T17:00:00-04:00',
end_at_timezone: 'America/New_York',
per_user_view_limit: null,
per_user_view_period: null,
quota_lifetime: 10000,
quota_type: 'views',
under_delivery_behaviour: 'endOnDate',
day_parting_id: 1234,
status: 'active'
})
};
fetch('https://api.hakumedia.ai/v2/schedules/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.hakumedia.ai/v2/schedules/{id}"
payload = {
"day_cap_limit": 1111,
"day_cap_type": "clicks",
"delivery_method": "default",
"start_date": "2018-09-15 00:00:00",
"end_date": "2019-10-15 00:00:00",
"start_at": "2024-11-01T09:00:00-04:00",
"start_at_timezone": "America/New_York",
"end_at": "2024-11-15T17:00:00-04:00",
"end_at_timezone": "America/New_York",
"per_user_view_limit": None,
"per_user_view_period": None,
"quota_lifetime": 10000,
"quota_type": "views",
"under_delivery_behaviour": "endOnDate",
"day_parting_id": 1234,
"status": "active"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.hakumedia.ai/v2/schedules/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'day_cap_limit' => 1111,
'day_cap_type' => 'clicks',
'delivery_method' => 'default',
'start_date' => '2018-09-15 00:00:00',
'end_date' => '2019-10-15 00:00:00',
'start_at' => '2024-11-01T09:00:00-04:00',
'start_at_timezone' => 'America/New_York',
'end_at' => '2024-11-15T17:00:00-04:00',
'end_at_timezone' => 'America/New_York',
'per_user_view_limit' => null,
'per_user_view_period' => null,
'quota_lifetime' => 10000,
'quota_type' => 'views',
'under_delivery_behaviour' => 'endOnDate',
'day_parting_id' => 1234,
'status' => 'active'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"day_cap_limit": 1111,
"day_cap_type": "clicks",
"delivery_method": "default",
"start_date": "2018-09-15 00:00:00",
"end_date": "2019-10-15 00:00:00",
"start_at": "2024-11-01T09:00:00-04:00",
"start_at_timezone": "America/New_York",
"end_at": "2024-11-15T17:00:00-04:00",
"end_at_timezone": "America/New_York",
"per_user_view_limit": null,
"per_user_view_period": null,
"quota_lifetime": 10000,
"quota_type": "views",
"under_delivery_behaviour": "endOnDate",
"day_parting_id": 1234,
"status": "active",
"created_date": "2019-01-22 00:00:00",
"clicks": 0,
"views": 0,
"quote_remaining": null,
"object": "schedule",
"self": "/v2/schedules/1234",
"id": 1234,
"end_date_local": "2019-05-26 15:32:06",
"start_date_local": "2019-05-26 15:32:06"
}Authorizations
API key en el header Authorization: Basic TU_API_KEY. La key va tal cual, sin codificar en base64. Las credenciales se entregan al comenzar la integración.
Path Parameters
Identifier of the schedule you'd like to update.
Body
The number of times an ad will be shown in a day. Accepts any integer except 0. Defaults to null.
1111
Whether to impose daily limits on the amount of views ("views") or the amount of clicks ("clicks").
"clicks"
Whether to deliver the impressions as quickly as possible ("default") or deliver it evenly ("smooth") over the specified duration (start_date and end_date) and quota (quota_lifetime and quota_type). Default delivery delivers the impressions as quickly as possible. Smooth delivery will evenly serve over the lifetime dates and quotas. Defaults to "default".
NOTE:
-
Placements with
serve_methodset to "auction" will always be delivered using the "default" method regardless of this field's value. -
Only subscribers on the Standard tier and above have access to smooth delivery. If you don't have that feature enabled, you must set this field's value to "default".
-
If you change your subscription from Standard tier and above to a lower tier, any placements that have already been set to smooth delivery will remain under that delivery method.
"default"
The time and date when an ad should begin serving. Delay serving of ads by setting the start_date to a date in the future. Defaults to midnight of the current date if no value or null given.
The date-time value received is assumed to be in the Haku account's time zone as defined on account creation. You can check your account's time zone in the Haku Settings page.
In the response body, start_date is returned in Haku’s server time zone (America/Los_Angeles). To see the end date in the Haku account's chosen timezone, see start_date_local.
"2018-09-15 00:00:00"
The time and date when an ad should stop serving. The end date can be as far in the future as desired. This allows you to set time-based expiration for your ads, and we guarantee accuracy to the hour. Set the field to null if you want ad serving to run indefinitely.
The date-time value received is assumed to be in the Haku account's time zone as defined on account creation. You can check your account's time zone in the Haku Settings page.
In the response body, end_date is returned in Haku’s server time zone (America/Los_Angeles). To see the end date in the Haku account's chosen timezone, see end_date_local.
"2019-10-15 00:00:00"
The time and date when an ad should begin serving, in ISO-8601 format. Delay serving of ads by setting start_at to a date in the future. Defaults to midnight of the current date if no value or null given.
The timezone given in the ISO formatted date here does not have to match the start_at_timezone field. However, the start date will be converted to the timezone specificed in start_at_timezone when the value is returned.
"2024-11-01T09:00:00-04:00"
The timezone of the start_at field. This is primarily for usage in UI interfaces so that the user can set certain timezones for different schedules. This could be useful if a customer has ordered a schedule to run from the first of the month to the 15th, starting at 9am and ending at 5pm, but the timezone is very different from the one the account or user is in. The timezone is in the IANA timezone format, such as America/New_York. A complete list of acceptable timezones by country is given here.
If no timezone is given, the account's default timezone is used.
"America/New_York"
The time and date when an ad should stop serving, in ISO-8601 format. The end date can be as far in the future as desired. This allows you to set time-based expiration for your ads, and we guarantee accuracy to the hour. Set the field to null if you want ad serving to never end.
The timezone given in the ISO formatted date here does not have to match the end_at_timezone field. However, the end date will be converted to the timezone specificed in end_at_timezone when the value is returned.
"2024-11-15T17:00:00-04:00"
The timezone of the end_at field. This is primarily for usage in UI interfaces so that the user can set certain timezones for different schedules. This could be useful if a customer has ordered a schedule to run from the first of the month to the 15th, starting at 9am and ending at 5pm, but the timezone is very different from the one the account or user is in. The timezone is in the IANA timezone format, such as America/New_York. A complete list of acceptable timezones by country is given here.
If no timezone is given, the account's default timezone is used.
"America/New_York"
The number of times the ad will be shown to a particular user in a time period given by per_user_view_period. An integer value enables frequency capping and must be specified along with per_user_view_period. Both fields default to null, which means frequency capping is disabled.
null
The number of days after which the per_user_view_limit counter will start over. This field must be specified along with per_user_view_limit. Both fields default to null, which means frequency capping is disabled.
null
The targeted number of impressions or clicks to deliver for a placement with a quota-based expiration method, where the ad or campaign will stop being served once the quota for "views" or "clicks" is met. Haku will calculate the remaining inventory based on this value.
10000
The type of quota when setting up quota-based expiration for a placement. It can be the number of clicks ("clicks") or the number of views ("views"). When a placement has a quota-based expiration, it will stop being served once it reaches the given clicks or views.
"views"
Whether to keep serving ads until the quota is met ("endOnQuota") or stop serving them right away ("endOnDate") once the end date has been reached. Defaults to endOnDate if delivery_method is "smooth". Defaults to null if delivery_method is "default".
"endOnDate"
The day_parting identifier if dayparting is enabled for this schedule.
NOTE: Subscribers must have the Targeting add-on to enable dayparting. If you don't have this add-on, you must set this field's value to null.
1234
The status of the schedule, determined using the start and end dates and quotas. All possible statuses are: "active", "queued", "expired", and "quota_reached".
"active"
Response
successful operation
The number of times an ad will be shown in a day. Accepts any integer except 0. Defaults to null.
1111
Whether to impose daily limits on the amount of views ("views") or the amount of clicks ("clicks").
"clicks"
Whether to deliver the impressions as quickly as possible ("default") or deliver it evenly ("smooth") over the specified duration (start_date and end_date) and quota (quota_lifetime and quota_type). Default delivery delivers the impressions as quickly as possible. Smooth delivery will evenly serve over the lifetime dates and quotas. Defaults to "default".
NOTE:
-
Placements with
serve_methodset to "auction" will always be delivered using the "default" method regardless of this field's value. -
Only subscribers on the Standard tier and above have access to smooth delivery. If you don't have that feature enabled, you must set this field's value to "default".
-
If you change your subscription from Standard tier and above to a lower tier, any placements that have already been set to smooth delivery will remain under that delivery method.
"default"
The time and date when an ad should begin serving. Delay serving of ads by setting the start_date to a date in the future. Defaults to midnight of the current date if no value or null given.
The date-time value received is assumed to be in the Haku account's time zone as defined on account creation. You can check your account's time zone in the Haku Settings page.
In the response body, start_date is returned in Haku’s server time zone (America/Los_Angeles). To see the end date in the Haku account's chosen timezone, see start_date_local.
"2018-09-15 00:00:00"
The time and date when an ad should stop serving. The end date can be as far in the future as desired. This allows you to set time-based expiration for your ads, and we guarantee accuracy to the hour. Set the field to null if you want ad serving to run indefinitely.
The date-time value received is assumed to be in the Haku account's time zone as defined on account creation. You can check your account's time zone in the Haku Settings page.
In the response body, end_date is returned in Haku’s server time zone (America/Los_Angeles). To see the end date in the Haku account's chosen timezone, see end_date_local.
"2019-10-15 00:00:00"
The time and date when an ad should begin serving, in ISO-8601 format. Delay serving of ads by setting start_at to a date in the future. Defaults to midnight of the current date if no value or null given.
The timezone given in the ISO formatted date here does not have to match the start_at_timezone field. However, the start date will be converted to the timezone specificed in start_at_timezone when the value is returned.
"2024-11-01T09:00:00-04:00"
The timezone of the start_at field. This is primarily for usage in UI interfaces so that the user can set certain timezones for different schedules. This could be useful if a customer has ordered a schedule to run from the first of the month to the 15th, starting at 9am and ending at 5pm, but the timezone is very different from the one the account or user is in. The timezone is in the IANA timezone format, such as America/New_York. A complete list of acceptable timezones by country is given here.
If no timezone is given, the account's default timezone is used.
"America/New_York"
The time and date when an ad should stop serving, in ISO-8601 format. The end date can be as far in the future as desired. This allows you to set time-based expiration for your ads, and we guarantee accuracy to the hour. Set the field to null if you want ad serving to never end.
The timezone given in the ISO formatted date here does not have to match the end_at_timezone field. However, the end date will be converted to the timezone specificed in end_at_timezone when the value is returned.
"2024-11-15T17:00:00-04:00"
The timezone of the end_at field. This is primarily for usage in UI interfaces so that the user can set certain timezones for different schedules. This could be useful if a customer has ordered a schedule to run from the first of the month to the 15th, starting at 9am and ending at 5pm, but the timezone is very different from the one the account or user is in. The timezone is in the IANA timezone format, such as America/New_York. A complete list of acceptable timezones by country is given here.
If no timezone is given, the account's default timezone is used.
"America/New_York"
The number of times the ad will be shown to a particular user in a time period given by per_user_view_period. An integer value enables frequency capping and must be specified along with per_user_view_period. Both fields default to null, which means frequency capping is disabled.
null
The number of days after which the per_user_view_limit counter will start over. This field must be specified along with per_user_view_limit. Both fields default to null, which means frequency capping is disabled.
null
The targeted number of impressions or clicks to deliver for a placement with a quota-based expiration method, where the ad or campaign will stop being served once the quota for "views" or "clicks" is met. Haku will calculate the remaining inventory based on this value.
10000
The type of quota when setting up quota-based expiration for a placement. It can be the number of clicks ("clicks") or the number of views ("views"). When a placement has a quota-based expiration, it will stop being served once it reaches the given clicks or views.
"views"
Whether to keep serving ads until the quota is met ("endOnQuota") or stop serving them right away ("endOnDate") once the end date has been reached. Defaults to endOnDate if delivery_method is "smooth". Defaults to null if delivery_method is "default".
"endOnDate"
The day_parting identifier if dayparting is enabled for this schedule.
NOTE: Subscribers must have the Targeting add-on to enable dayparting. If you don't have this add-on, you must set this field's value to null.
1234
The status of the schedule, determined using the start and end dates and quotas. All possible statuses are: "active", "queued", "expired", and "quota_reached".
"active"
The date and time when the schedule was created.
"2019-01-22 00:00:00"
The number of clicks recorded so far.
0
The number of views recorded so far.
0
The number of impressions remaining to be served.
null
A string denoting the current resource being requested or affected.
"schedule"
The relative URL of the current resource being requested or affected.
"/v2/schedules/1234"
The current resource identifier (ID).
1234
The end_date value in the Haku account's timezone.
"2019-05-26 15:32:06"
The start_date value in the Haku account's timezone.
"2019-05-26 15:32:06"