External API Global Cannot Display Array

Hi,

I have set up an External API Global for the first time and am having trouble getting hold of the data I need. The API links to a cloud-based ticket sales platform. I am looking for data from the event_series ( Event series – Ticket Tailor API v1.0). The only data I am looking to bring through is the event’s date and location name.

On the page, I have an API Tester section and below that a section with a text element, which uses dynamic content. The API Tester shows all events in the series, as expected and hoped for. However, in the text, element I am only getting a single event, not a list of all events.

I cannot work out what is wrong and hope you may be able to help.

Thanks,
Christopher

The “Data Key” control should be data in your case. The API was returning a data key with all the loopable data inside that. I created a simple list of what you were trying to do under the API Tester.

image

If you intend to loop over data the starting character of your API Tester should be [. That’s how you’ll know it’s loopable.

image

Have a great day.

1 Like

@charlie, thank you very much. A great help! Two extra questions:

  • Some of the events do not have dates - any idea how I can grab and display them?

  • How can the output be sorted by date current to furthest in the future?

Many thanks again,
Christopher

  • There is a created_at key you can potentially use. In my next point there might be more data you can grab from that endpoint.
  • The docs say to use the event_series endpoint instead of events for what it’s worth. https://developers.tickettailor.com/#list-event-series It might arrange them by date better. There is unfortunately no way to do that on the Cornerstone end.

My instinct is that their API endpoints are possibly deliberately not interconnected, so embed codes are required to display data. Not ideal. The event_series interlinks with Event Occurances, but there seems to be no way to combine the two, unless I have missed something in my amateur nested looper example in the section below where you have done what you can.

I am very grateful for your expert knowledge to help cut this avenue short, if my assumptions are correct!

I gotcha. In that case you would probably need to grab event_occurrences first and then make another request on event_series for any data you would need there. That would work if the event occurrences are in the order you want.

I get your thoughts!

You can add another Looper Provider (External API Global) inside the existing Looper Provider with this path: /v1/event_series/{{dc:looper:field key=“id”}}/events. This should retrieve all events based on the event series ID.

1 Like

Hi Ismael,

Many thanks for that - it is sort of what I tried in the bottom section but without success.

Thanks,
Christopher

Thank you for the update.

it is sort of what I tried in the bottom section but without success.

Did you create the second Looper Provider inside an element that consumes the first loop?

The test page is no longer accessible. It looks like you have disabled the External API feature altogether and removed the Tailor Ticket domain. Please configure it again, then we’ll try to create a test page for you.

Warm regards.

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