External API Data Key

Hi,
I am trying to get Cornerstone to display a collection of videos from this API call: https://dev.vhx.tv/docs/api/#collection-items-list

I created a page and used the API Tester element. It works and populates the Success Response element just fine. As you can see in the API documentation, the response is nested. I am trying to get to “_embedded.items”. Hence I entered Data Key = _embedded.items in the Looper Provider.

The Looper doesn’t seem to traverse down the JSON. What am I doing wrong?

It’s hard to describe. Hence, I will add access to the Secure Note.

Many thanks in advance.

P.S. - I know the API call works as I have tested it on Postman and the API Tester returns data.

Hello @Stabal,

Thank you for the inquiry.

We replaced the value of the Data Key field with _embedded, added another Div element and applied a new Looper Provider > Dynamic Content set to {{dc:looper:field key=“response.items”}}, as shown in the screenshot below. You can now loop through the items in the _embedded object.

Let us know if you need more info.

Best regards,

Thank you @Ismael. Please help me understand, a data key cannot support “_embedded.items” (nested keys)? Is that why you added another DIV inside?

Again, thank you for your help.

Hey Erica,

There is no _embedded.items in the response. I would recommend that you use {{dc:looper:debug_consumer}} to display the response data.

You may need to nest another loop to be able to get the data you want to display. This is also the reason why @Ismael used another DIV element.

Best Regards.

Thank you!

Hi Erica,

You are most welcome. Please let me know if you need any further help with this.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.