Creating an Ad Set

You can create as many ad sets as you like, but you can only assign one ad set to a video.

Note: For Ooyala-hosted ads (ad source set to "My Ads"), in-stream and mid-roll ads are not currently supported. Do not select "In-Stream" or "mid-roll" as an ad position for ad sets with Ad Source set to "My Ads."

To create an ad set:

  1. Use the /v2/ad_sets route with the details of an ad to include in the POST body. The following example creates an ad set and associates the 01M2F0MTr3SWBB9dfAPT5xEsg8Gpy asset from the user's own assets with it.
    [POST]/v2/ad_sets{  
       "name":"My new Ad Set",
       "default":true,
       "ads":[  
          {  
             "ad_source":"assets",
             "ad_type":"preroll",
             "embed_code":"01M2F0MTr3SWBB9dfAPT5xEsg8Gpy",
             "plays_before":0,
             "plays_between":1,
             "click_url":"http://www.myclickurl.com",
             "tracking_pixel_urls":[  
                "http://www.mytrackingpixel.com"
             ]
          }
       ]
    }
    The Backlot UI responds similarly to the following.
    {  
       "name":"My new Ad Set",
       "id":"77506f70fc1e4b08805687980cc4a24d",
       "ads":[  
    
       ]
    }
    Note:

    Try out the code samples using your account credentials in the Ooyala Scratchpad. For information about using the Scratchpad, see Practice Making Requests with the Scratchpad. To launch the scratchpad, go to Ooyala API Scratchpad.

  2. Change the name of the ad set, using a PATCH with the /v2/ad_sets route and the identifier of the desired ad set.
    [PATCH]/v2/ad_sets/77506f70fc1e4b08805687980cc4a24d{  
       "name":"Ad Set #9",
    
    }
    The Backlot UI responds similarly to the following.
    {  
       "name":"Ad Set #9",
       "id":"77506f70fc1e4b08805687980cc4a24d",
    }
    Note:

    Try out the code samples using your account credentials in the Ooyala Scratchpad. For information about using the Scratchpad, see Practice Making Requests with the Scratchpad. To launch the scratchpad, go to Ooyala API Scratchpad.

해당 내용이 도움 되었습니까?