Skip to navigation

Plan: Stencil Developer

Lesson 18 of 23 · 30 min

In this lab you will

  • Create a Widget using Postman

Prerequisites

  • BC Sandbox
  • API credentials for the store (Content: Modify)
  • Postman installed
  • Widgets API collection

Create a Widget

Create a widget using Postman

  1. Navigate to the ‘Widgets and Page Builder’ folder in the ‘Widgets API Labs’ collection in the ‘Collections’ panel on the left side of the Postman window
  2. Click the ‘Create Widget’ post request
  3. Select the ‘Body’ tab in the main content window in Postman
  4. Confirm the content in the ‘Body’ tab is the following:
{
"name": "Static Image + Content Widget",
"widget_configuration": {
"heading_text": "Welcome to Our Store",
"image": {
"src": "https://images.unsplash.com/photo-1523275335684-37898b6baf30",
"type": "IMAGE_MANAGER"
},
"width": "400",
"text_block": "Shop our new arrivals before they sell out."
},
"widget_template_uuid": "{{widget_template_uuid}}"
}
  1. Confirm that the widget_template_uuid environment variable contains the Widget Template UUID from the end of Module 4: Lab - Create a Widget Template for Static Content. The request fills it in automatically
  2. Click the ‘Send’ button at the top right of the Postman window
  3. Observe the Widget UUID in the response section at the bottom of the Postman window. The request saves it to the widget_uuid environment variable, which is used in the next lab