Add Display Units
This use case describes the requirements for adding display units to your domain using Broadsign Control API via REST.
Note: The ID#s we use in these samples are for illustration purposes. They are invalid. Be sure to use your own ID#s for your integrations. Also, in our examples, we use the api-sandbox endpoint and HTTP token.
A basic display unit has a few different components: a display unit "shell", a day part, a frame and a criterion.
To add display units, use the following methods:
- Add a display unit using POST and the /display_unit/v12/add method.
- Add a day part to the display unit, using POST and the /day_part/v5/add method.
- Add a frame to the day part, using POST and the /skin/v7/add method.
- Add a criterion to the display unit, using POST and the /resource_criteria/v7/add method.
This step adds a new display unit to your domain.
curl -X POST \
https://api-sandbox.broadsign.com:10889/rest/display_unit/v12/add \
-H 'authorization: Bearer YourAPIKeyHere' \
-H 'cache-control: no-cache' \
-H 'content-type: application/json' \
-d '{
"display_unit_type_id": 567,
"enforce_day_parts": true,
"name": "cURL Display Unit",
"container_id": 9999,
"domain_id": 123456789
}'
This step adds a day part to your new display unit. Use the response from Step 1: Add a Display Unit in the parent_id request parameter.
curl -X POST \
https://api-sandbox.broadsign.com:10889/rest/day_part/v5/add \
-H 'authorization: Bearer YourAPIKeyHere' \
-H 'cache-control: no-cache' \
-H 'content-type: application/json' \
-d '{
"name": "24/7",
"day_mask": 127,
"parent_id": 3232,
"start_date": "",
"end_date": "",
"start_time": "00:00:00",
"end_time": "00:00:00",
"virtual_start_date": "1756-01-01",
"virtual_end_date": "8000-12-31",
"impressions_per_hour": -1,
"weight": 0,
"domain_id": 123456789
}'
This step adds a frame to your new day part (and, by extension, to your new display unit). Use the response from Step 2: Add a Day Part in the parent_id request parameter.
curl -X POST \
https://api-sandbox.broadsign.com:10889/rest/skin/v7/add \
-H 'authorization: Bearer YourAPIKeyHere' \
-H 'cache-control: no-cache' \
-H 'content-type: application/json' \
-d '{
"parent_id": 3233,
"geometry_type": 1,
"height": 100,
"width": 100,
"x": 0,
"y": 0,
"name": "Fullscreen cURL",
"loop_policy_id": 357,
"screen_no": 1,
"domain_id": 123456789
}'
Finally, you will add a criterion to your display unit for fine-grained targeting.
This final step adds a criterion to your new display unit. Use the response from Step 1: Add a Display Unit in the parent_id request parameter. For the criteria_id parameter, use the unique ID# of an existing criterion on your domain.