How to determine subplaylist in a layout from API

We have a fairly simple Layout:

  • Only one Region in the Layout
  • The region only has a SubPlaylist widget

We would like to easily determine the ID and Playlist name for the subplaylist via API integration. This looks to be the only way:

  • Use the Search Layout endpoint using embed=regions,playlist,widgets option.
  • Navigation the JSON data returned to find the Playlist ID by:
    • Find Regions array then navigate to the first/only regionplaylist object
    • Navigate to Widgets array then navigate to the widgetOptions array on the first/only widget
    • Navigate through the widgetsOptions array until option=subPlaylistIds is found and save the value of “value”
  • Use the Search Playlist endpoint with a playlistID equal to the above value to get the name

Is the above the only way to obtain the name and ID of the playlist? If we have multiple regions in the layout then the complexity to find this information increases.