Campaign JSON Import | AdMaster

Campaign JSON Import

Use this guide to create campaigns from a JSON file. For example, you can turn a schedule from another system into a file and load it into AdMaster Cloud.

What import does

  • Import reads a JSON file (or pasted JSON text) and creates new campaigns.
  • Import never changes a campaign that already exists.
  • Every new campaign gets status pending, a new campaign number, and you as the owner.
  • Import does not load audio files. See "Spots" below.
  • You can import up to 20 campaigns at one time.

Where to find it:

  1. Open Campaigns.
  2. Click Import campaign.
  3. Choose Campaign JSON.
  4. Click Select JSON file(s) or drag the files into the box. Or paste the JSON text in the text box below.
  5. Click Import campaigns.

You need the permission to create campaigns. If you cannot create campaigns, the Import campaign button is not shown.

A file can hold one campaign (one { ... } object) or many campaigns (an array [ { ... }, { ... } ]). You can select many files at one time.

The two steps: preview and create

Import has two steps. Nothing is saved in the first step.

Step 1 - Preview. AdMaster does a test run and shows the result for each campaign:

  • the customer and the agency, marked Existing or New
  • the salesperson
  • the stations, and which station of your network each one matched
  • for a manual schedule, the number of schedule rows
  • the warnings
  • the campaigns with errors (these cannot be imported)

If a station name in the file does not exist in your network, you see a list. Select the right station for it. If you do not select one, AdMaster uses the first station of your network.

Click Back to change the file or the text. Your file and text stay in place.

Step 2 - Create. Click Create campaigns. AdMaster creates the campaigns, the new customers and agencies, and the spots. Each campaign is created on its own. If one campaign has an error, the other campaigns are still created.

Warnings do not stop the import. Read them before you click Create campaigns.

Minimal example (segment campaign)

A segment campaign plays spots in time ranges ("segments"), for example 4 plays per day between 06:00 and 10:00.

This example makes one campaign with two spots and one segment. It plays on Monday to Friday, from 06:00 to 09:59. Download this example.

{
  "schema_version": 1,
  "campaign": {
    "basics": {
      "name": "Spring Sale March 2027",
      "customer": {"name": "Green Valley Furniture"},
      "agency": {"name": "Bright Media Agency"},
      "currency": "EUR"
    },
    "flight": {"start_date": "2027-03-01", "end_date": "2027-03-31"},
    "stations": [
      {"name": "Radio One"}
    ],
    "spots": [
      {"label": "A", "name": "Spring Sale 30s", "duration": 30},
      {"label": "B", "name": "Spring Sale 20s", "duration": 20}
    ],
    "schedule": {
      "type": "variable",
      "segments": [
        {
          "number": "Morning drive",
          "start_date": "2027-03-01",
          "end_date": "2027-03-31",
          "weekdays": [true, true, true, true, true, false, false],
          "hours": {"min": 6, "max": 10, "plays": 4},
          "spot_shuffle": "percentage",
          "spots": [
            {"label": "A", "percentage": 60},
            {"label": "B", "percentage": 40}
          ]
        }
      ]
    }
  }
}

What happens:

  • The customer and agency are created if they do not exist yet.
  • Two spots are created (A and B), without audio files.
  • The segment plays 4 times each day. 60% of the plays are spot A and 40% are spot B.

Example with a manual schedule

A manual schedule lists every play by hand: one spot at one hour of one day. Use "type": "manual" and a list called entries. Download this example.

{
  "schema_version": 1,
  "campaign": {
    "basics": {
      "name": "Weekend Offer March 2027",
      "customer": {"name": "Green Valley Furniture"},
      "agency": {"name": "Bright Media Agency"}
    },
    "flight": {"start_date": "2027-03-06", "end_date": "2027-03-07"},
    "stations": [
      {"name": "Radio One"}
    ],
    "spots": [
      {"label": "A", "name": "Weekend Offer 30s", "duration": 30},
      {"label": "B", "name": "Weekend Offer 15s", "duration": 15}
    ],
    "schedule": {
      "type": "manual",
      "entries": [
        {
          "datetime": "2027-03-06T08:00:00",
          "spot": {"label": "A"}
        },
        {
          "datetime": "2027-03-06T08:00:00",
          "spot": {"label": "B"},
          "position": 90
        },
        {
          "datetime": "2027-03-06T17:00:00",
          "spot": {"label": "A"},
          "plays": 2,
          "breaks": [0]
        },
        {
          "datetime": "2027-03-07T09:00:00",
          "spot": {"label": "B"},
          "price_amount": 150
        }
      ]
    }
  }
}

What happens:

  • Four schedule rows are created. All rows go to all stations of the campaign.
  • 08:00 on 6 March has two spots. B asks for a late place in the break (position 90).
  • 17:00 on 6 March plays spot A 2 times, in the first break only (breaks: [0]).
  • 09:00 on 7 March plays spot B with its own price of 150.
  • The campaign dates are set from the first and last row. A manual campaign has no segments.

Fields

All dates are text. All names are text. Field names are in lower case.

Top level

Field Type Required Default Note
schema_version number Yes - Must be 1. Other numbers are refused.
campaign object Yes - Holds everything below.

campaign.basics

Field Type Required Default Note
name text No Customer name Max 255 characters. If a campaign with this name exists, you get a warning. The import still works.
customer object Yes - { "name": "..." }. Without a customer name the campaign cannot be imported.
customer.name text Yes - AdMaster finds the customer by name (upper or lower case does not matter). It also checks the business name. If there is no match, a new customer is created.
customer.type_of_business text No empty Only for a new customer. Must match a business category of your network. AdMaster does not create categories.
agency object No none { "name": "..." }. Works like customer, but AdMaster looks only in agencies.
salesperson object No empty { "email": "...", "name": "..." }. AdMaster checks the email first, then the full name. Only people of your network match. If not found, the field stays empty.
currency text No - The currency of the prices in the file, for example "EUR". If it is not the currency of your network, you get a warning. AdMaster does not convert amounts.
separation text No auto auto, manual or none.
priority text No normal normal, lower or lowest.

AdMaster ignores campaign.uuid, campaign.status and basics.number if they are in the file. The new campaign always gets its own number and status.

campaign.flight

Field Type Required Default Note
start_date date Recommended Today Format YYYY-MM-DD. If it is missing or wrong, AdMaster uses today and shows a warning.
end_date date Recommended Start date + 29 days Format YYYY-MM-DD. The whole end day is included. If it is missing, wrong, or before the start date, AdMaster uses the default and shows a warning.
unlimited true/false No false If true, the campaign has no real end.
limits object No no limits budget, plays and seconds. Each one is { "enabled": true, "value": 1000 }.

For a manual schedule, AdMaster sets the campaign dates from the first and last schedule row. You can still give start_date and end_date to avoid the date warnings.

campaign.stations

A list of stations: [ { "name": "Radio One" } ].

Field Type Required Default Note
name text Yes (or uuid) - The station name must be the same as in your network. Upper or lower case does not matter. Part of a name does not match.
uuid text No - The station ID. AdMaster checks it first. An ID from another network does not match.

If the list is empty, AdMaster uses the stations named in the segments. If there are none, it uses the first station of your network and shows a warning.

campaign.spots

A list of spots. Import creates one new spot for each item.

Field Type Required Default Note
label text Yes if you use the label to link the spot next free label Short name, for example A or 1. Max 30 characters. Each label must be different. A missing or repeated label is replaced by a new label.
name text No Campaign name + label The spot name. Max 255 characters.
duration number No 30 Length in seconds. If it is missing or 0 or less, AdMaster uses 30.
uuid text No - Your own ID for the spot. It is only used to link the spot inside the file.

campaign.schedule

Field Type Required Default Note
type text No variable variable, static or manual. See below.
segments list For variable and static empty The time ranges. Ignored (with a warning) for manual.
entries list For manual empty The schedule rows. Ignored (with a warning) for other types.

Schedule types:

  • variable: each segment has a time range (min to max) and a number of plays. AdMaster picks the exact times.
  • static: each segment lists the exact hours and the plays for each hour.
  • manual: you list every play in entries.

schedule.segments[]

Field Type Required Default Note
number text No Order number The segment name. Max 40 characters.
order_number number No Position in the list Sort order.
start_date date No Campaign start YYYY-MM-DD.
end_date date No Campaign end YYYY-MM-DD. Must not be before start_date, or the campaign has an error.
type text No Same as schedule.type variable or static.
weekdays list of 7 true/false No all true Monday first. See "Formats".
hours object or list Recommended whole day (variable) See "Hours" below. Without hours a variable segment uses the whole day (0 to 24) with 1 play, and you get a warning.
stations list No all campaign stations Only stations that are on the campaign are used. Others are skipped with a warning.
spots list Recommended none Links to the spots. See "Spots" below. Without spots, nothing plays.
spot_shuffle text No random random, consecutive or percentage. Use percentage to use the percentages of the spots.
position number No none Place in the break, 1 to 100. See "Position in the break".
breaks list of numbers No all breaks Numbers of the breaks. The first break is 0.
unlimited true/false No false
pricing object No no price { "type": "...", "config": { ... } }. Types: flat, none, per_day, per_month, per_play, per_second, per_week. config is { "amount": 120 }: the price in your network currency. For none, leave config empty: {}. A wrong price gives a warning. The segment is created without a price.

Hours for a variable segment (an object):

Field Type Required Note
min whole number Yes First hour, 0 to 24.
max whole number Yes End hour, 0 to 24. max is not included (see "Formats").
plays whole number Yes Plays on each day. Max 1000. A bigger number is changed to 1000 with a warning.
inverse true/false No (default false) If true, the segment plays outside the range min to max.
is_different_plays true/false No If true, you must give different_plays.
different_plays list of 7 numbers If is_different_plays is true Plays for each weekday, Monday first.

Hours for a static segment (a list): [ { "hour": 7, "plays": 1 }, { "hour": 8, "plays": 2 } ]. hour is a whole number from 0 to 23. plays is a whole number, max 20 for each hour (a bigger number is changed to 20 with a warning).

schedule.entries[] (manual schedule)

Field Type Required Default Note
datetime text Yes - YYYY-MM-DDTHH:MM:SS, for example 2027-03-06T08:00:00. Station local time. A date without a time is not valid.
spot object Yes - Link to a spot of the same file: { "label": "A" }.
plays whole number No 1 From 1 to 20. A bigger number becomes 20. A wrong number becomes 1. Both give a warning.
breaks list of numbers No all breaks Numbers of the breaks. The first break is 0. Wrong values are removed, with a warning. If no value is left, the row uses all breaks.
position whole number No none Place in the break, 1 to 100. A wrong value is ignored with a warning.
price_amount number No station price The price of this row. 0 means free. A wrong value is ignored with a warning.

There is no station field. One schedule goes to all stations of the campaign.

AdMaster does not import spot groups. A row with spot_group is skipped with a warning.

Formats

Dates (flight, segments)

  • Write YYYY-MM-DD, for example 2027-03-31. This is the best format.
  • A date with a time (2027-03-31T00:00:00) is also accepted. For the end date, it then ends at that time. Use a plain date to include the whole last day.

Hours (min and max)

  • Use whole numbers from 0 to 24.
  • min is the first hour that plays. max is the end. The hour max is not included.
  • Example: min 6, max 10 plays in the hours 6, 7, 8 and 9. That is 06:00 to 09:59.
  • Whole day: min 0, max 24.
  • min must be smaller than max. A night range like 20 to 6 is not valid. Write it as min 6, max 20, inverse true. This plays from 20:00 to 05:59.
  • inverse true with min 0 and max 24 is not valid (no hour is left).

Days of the week (weekdays)

  • A list of exactly 7 values: Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday.
  • true means the segment plays on that day.
  • Example: [true, true, true, true, true, false, false] is Monday to Friday.
  • If the list does not have 7 values, AdMaster uses all days.

Time zone

  • The hour of a schedule row (datetime) is the local time of the station. Write the time that you want on the station clock.
  • AdMaster does not convert time zones. If you add an offset like +02:00 or Z, AdMaster ignores it. 08:00:00+02:00 is read as 08:00 at the station.

Full hour

  • A schedule row is always for a full hour. A time like 08:30:00 is moved to 08:00, and you get a warning.
  • The same spot twice in the same hour is kept once. The second row is skipped with a warning.

Duration

  • duration of a spot is in seconds, as a whole number.

Position in the break

  • position is a number from 1 to 100. A small number means the beginning of the break. A big number means the end of the break.
  • Under 20: first in the break. Over 80: last in the break. 20 to 40: upper third. 40 to 60: middle. 60 to 80: lower third.
  • AdMaster tries to follow the position, but it can not always do it.
  • Do not use numbers over 100.

Breaks

  • breaks lists the breaks where the spot may play. The numbers start at 0: 0 is the first break of the hour, 1 is the second break.
  • An empty list or no breaks means all breaks.

Numbers

  • Write numbers without quotes: "plays": 4.
  • Percentages of spots are rounded to whole numbers.

Spots

Spots are created without an audio file. You do not need the audio before the import.
  • Import creates a new spot for each item in campaign.spots. The spot has a name, a label and a duration. It has no audio file.
  • After the import, open the campaign in AdMaster and upload the audio file for each spot. Use the warning "Spots are created without media files" as a reminder.
  • The spot is a placeholder until you add the audio. You do not need the audio before the import.
  • Import does not use spots that already exist in AdMaster. It always makes new spots for this campaign.

How a segment or a schedule row finds its spot

A segment (in spots) or a schedule row (in spot) points to a spot from campaign.spots of the same file. AdMaster checks, in this order:

  1. uuid (the same uuid that you gave in campaign.spots)
  2. name (upper or lower case does not matter)
  3. label (upper or lower case does not matter)

The easiest way is to give each spot a short label and use only the label to link it:

"spots": [ { "label": "A", "name": "Spring Sale 30s", "duration": 30 } ]
...
"spots": [ { "label": "A", "percentage": 60 } ]

Notes:

  • percentage is only used if the segment has "spot_shuffle": "percentage". The percentages should add up to 100. If not, you get a warning.
  • If a spot is not found in the file, a segment gets the warning "Spot not matched". A schedule row with an unknown spot is skipped.
  • A segment without any spot gets a warning, and nothing plays in it.
  • All spots are linked to all stations of the campaign.
  • Spot groups (spot_groups) are not imported. They are skipped with a warning.

Stations, customers and agencies

Stations

  • AdMaster looks for the station by uuid, then by name, in your network only.
  • If the station is not found, AdMaster uses the first station of your network. You get the warning "Station ... replaced with ...".
  • In the preview you can select another station. Then there is no warning for that station.
  • If the file has no station at all, AdMaster uses the first station of your network.

Customers and agencies

  • A customer is searched among customers. An agency is searched among agencies. A customer never matches an agency.
  • AdMaster looks by uuid, then by name (also the business name). It does not matter if you write the name in upper or lower case.
  • If it is not found, AdMaster creates a new one with that name and a new customer number. You get the warning "New customer created" or "New agency created". The preview shows New.
  • Write the name exactly as it is in AdMaster. If you write "Green Valley" and the customer is "Green Valley Furniture", AdMaster creates a second customer.
  • If the file has no customer name, the campaign has an error and is not imported.

Salesperson

  • AdMaster looks by email, then by full name, among the people of your network.
  • If it is not found, the salesperson stays empty and you get a warning.

Warnings and errors

Warnings

A warning means: the import works, but AdMaster changed or skipped something. Read them in the preview. [X] and [Y] are replaced by values.

Warning What it means
New customer created: [X] The customer was not found. A new customer is created.
New agency created: [X] The agency was not found. A new agency is created.
Business category not found: [X] type_of_business does not exist in your network. The new customer has no category.
Salesperson not matched: [X] No person of your network matches. The salesperson is empty.
A campaign named [X] already exists The name is already used. The campaign is still created.
Prices are in [X], this network uses [Y] - amounts are not converted currency is different from your network currency.
Separation [X] is not valid - [Y] is used separation is wrong. auto is used.
Priority [X] is not valid - [Y] is used priority is wrong. normal is used.
Campaign start date is missing or invalid - [X] is used AdMaster uses the date shown.
Campaign end date is missing or invalid - [X] is used AdMaster uses the date shown.
Station [X] replaced with [Y] The station is not in your network. Another station is used. The preview shows this as a station list instead of a warning line.
No station in the JSON - the campaign uses [X] The file has no station. The first station of the network is used.
Spots are created without media files - upload them on the campaign Reminder: add the audio files after the import.
Spot groups are not imported: [X] Spot groups are skipped.
Spot not matched: [X] A segment points to a spot that is not in campaign.spots.
Segment [X] has no spots - nothing will air The segment has no spot.
Segment [X]: spot percentages add up to [Y], not 100 Only for spot_shuffle: percentage.
Segment [X]: spot groups are not imported The segment has spot_groups. They are skipped.
Segment [X] has no hours - the whole day is used A variable segment without hours.
Segment [X]: plays capped to [Y] Too many plays. The maximum is used (1000 for variable, 20 for each hour of static).
Segment [X]: station [Y] is not on the campaign and was skipped The segment names a station that is not in campaign.stations.
Segment [X]: price not applied ([Y]) The pricing is wrong. The segment has no price.
Segments are ignored for a manual schedule type is manual, so segments are not used.
Schedule entries were skipped - the campaign does not use a manual schedule entries is in the file, but type is not manual.
Manual schedule is not imported - the campaign is created without a schedule type is manual, but there are no entries.
Manual schedule has no usable rows - the campaign is created without a schedule All rows are wrong.
Manual schedule rows skipped - invalid or missing datetime: [X] [X] rows have no valid datetime (or only a date).
Manual schedule rows skipped - spot not found: [X] ([Y]) [X] rows point to an unknown spot. [Y] shows the first spot names.
Manual schedule rows skipped - spot groups are not imported: [X] ([Y]) [X] rows use spot_group.
Manual schedule rows skipped - the same spot twice in the same hour: [X] Only the first row is kept.
Manual schedule rows moved to the start of their hour: [X] [X] rows had minutes. They are set to the full hour.
Manual schedule rows with more than 20 plays - 20 is used: [X] plays is over 20.
Manual schedule rows with invalid plays, breaks or position - the default is used: [X] A wrong plays, breaks or position. The wrong value is not used. See schedule.entries[] for what is used instead.
Manual schedule rows with an invalid price - the station price is used: [X] A wrong price_amount.

Errors

An error means: this campaign is not imported. The other campaigns of the same import are not affected. The preview shows the error in a red card.

Error What to do
Invalid JSON The file is not valid JSON. Check commas and quotes.
Invalid JSON - the campaign object is missing Add the campaign object.
Unsupported schema version: [X] Set "schema_version": 1.
Customer is missing Add basics.customer.name.
The network has no stations Your network has no station. Create one first.
Segment [X]: hours are invalid min, max or plays are missing, not whole numbers, or out of range. For static, hour must be 0 to 23.
Segment [X]: plays must be a whole number Do not use decimals like 2.5.
Segment [X]: hours min must be before max ... Use min smaller than max. For night hours use inverse.
Segment [X]: inverse hours 0-24 leave no hour to air in ... Use inverse: false for the whole day.
Segment [X]: end date is before start date Change the segment dates.
Segment [X] is invalid ... A segment field has a wrong value.
Manual schedule is invalid: [X] The schedule rows could not be saved.
Too many campaigns in one import - the limit is [X] Use up to 20 campaigns for each import.

Questions? Write to support@admaster.info or use the chat icon in the corner.