Creating a Syndication

After creating a syndication, you can associate it with labels; all videos and channels that use the one of the labels will automatically be syndicated using the settings.

To create a syndication:

  1. Use the /v2/syndications route, specifying the name and type (advanced, boxee, google, iphone, iphone_abr, itunes, mp4, or roku). The following example creates the "My iPhone Feed" iPhone feed.
    [POST]/v2/syndications{  
       "name":"My iPhone Feed",
       "type":"iphone"
    }
    Note: If you are creating a YouTube feed, you must also specify your YouTube username and password.

    Backlot returns a response similar to the following.

    {  
       "name":"My iPhone Feed",
       "include_encodings":[  
    
       ],
       "destination_url":"",
       "require_access_key":false,
       "title":"",
       "include_labels":[  
    
       ],
       "asset_types":[  
          "video",
          "ad"
       ],
       "syndication_url":"http://api.ooyala.com/syndications/6b6e72dd71bd4fa/feed?pcode=Y4cG06BlqYMLIjPGyv1NbacSK-x3",
       "id":"6b6e72dd71bd4fa",
       "include_all_content":false,
       "type":"iphone",
       "description":""
    }
    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. For the feed to contain videos and other assets, you must add labels. Whenever you add a label to an asset that is associated with a feed, the asset is automatically added to the feed. The following example adds the 638aed2a18734375b and c42b225963ad481b9 labels to the 6b6e72dd71bd4fa syndication.
    [PATCH]/v2/syndications/6b6e72dd71bd4fa{  
       "include_labels":[  
          "638aed2a18734375b",
          "c42b225963ad481b9"
       ]
    }

    Backlot returns a response similar to the following.

    {  
       "name":"My iPhone Feed",
       "include_encodings":[  
    
       ],
       "destination_url":"",
       "require_access_key":false,
       "title":"",
       "include_labels":[  
          "638aed2a18734375b",
          "c42b225963ad481b9"
       ],
       "asset_types":[  
          "video",
          "ad"
       ],
       "syndication_url":"http://api.ooyala.com/syndications/6b6e72dd71bd4fa/feed?pcode=Y4cG06BlqYMLIjPGyv1NbacSK-x3",
       "id":"6b6e72dd71bd4fa",
       "include_all_content":false,
       "type":"iphone",
       "description":""
    }
  3. To filter the types of encodings provided, you can specify device or container limits. The following example restricts the encodings to iPhone and the container to MP4 for the 6b6e72dd71bd4fa syndication.
    [PATCH]/v2/syndications/6b6e72dd71bd4fa{  
       "include_encodings":[  
          {  
             "device":"iphone",
             "container":"mp4"
          }
       ]
    }

    Backlot returns a response similar to the following.

    {  
       "name":"My iPhone Feed",
       "include_encodings":[  
          {  
             "device":"iphone",
             "container":"mp4"
          }
       ],
       "destination_url":"",
       "require_access_key":false,
       "title":"",
       "include_labels":[  
          "638aed2a18734375b",
          "c42b225963ad481b9"
       ],
       "asset_types":[  
          "video",
          "ad"
       ],
       "syndication_url":"http://api.ooyala.com/syndications/6b6e72dd71bd4fa/feed?pcode=Y4cG06BlqYMLIjPGyv1NbacSK-x3",
       "id":"6b6e72dd71bd4fa",
       "include_all_content":false,
       "type":"iphone",
       "description":""
    }

The syndication is successfully created.

Note: Labels, encodings, and other settings can be specified during the initial creation of the syndication.

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