How can I get a full list of subcategories?

23 views
Skip to first unread message

Denis Fortuna

unread,
Sep 30, 2019, 11:04:10 AM9/30/19
to Eventbrite Developers
Summarize Problem:
I'm working on an app that would need to get the event's subcategory names from the event's subcategory ids. 

What have you already tried?
I tried to make a dictionary { eventId : event_name } with what I receive from the GET request I found on the documentation:

curl -X GET   https://www.eventbriteapi.com/v3/subcategories/   -H 'Authorization: Bearer PERSONAL_OAUTH_TOKEN'

Here's the response:

{
    "pagination": {
        "object_count": 197,
        "page_number": 1,
        "page_size": 50,
        "page_count": 4,
        "continuation": "eyJwYWdlIjogMn0",
        "has_more_items": true
    },
    "subcategories": [ ... ]
}

The array "subcategories" comes with just part of the total with the "has_more_items": true

How could I format the GET url in order to get the other pages?

Describe the expected results:

Nicholas Swekosky

unread,
Sep 30, 2019, 11:15:38 AM9/30/19
to Eventbrite Developers
One way to potentially solve your issue of wanting the subcategory names would be to use an expansion on the call for an event. The following page may prove helpful:
If you are interested in paginating through the responses, you will need to use the 'continuation' field provided in the pagination object. The following page may prove helpful:
Many of the unofficial software clients available on GitHub include mechanisms to paginate or expand requests. If you are using one to your benefit, feel free to paste a link here and I or someone else would be open to helping.

Does this help?

Jacob

unread,
Sep 30, 2019, 11:55:52 AM9/30/19
to eventbr...@googlegroups.com
Hi Denis!

Thanks for reaching out to us! I'm happy to try and provide some clarity on this issue.

Nicholas is absolutely correct that you should be able to access the full list by using the continuation token!

Your token should be displayed at the top of your response, similar to this:

{'pagination': {'continuation': '[continuation token]',
                'has_more_items': True,
                'object_count': 197,
                'page_count': 4,
                'page_number': 1,
                'page_size': 50},

You should be able to simply re-call the endpoint, adding the continuation token as a query string parameter (like so: v3/subcategories/?continuation=[continuation token]) and then your next page will be returned. You'll just need to repeat this process until you've retrieved all the pages.

The steps are also all laid out in the link that Nicholas shared: https://www.eventbrite.com/platform/api#/introduction/paginated-responses/using-a-continuation-token

Hope this helps! Please let me know if there's anything else I can clarify or assist with.



Best,

-Jacob
Eventbrite Developer Support


Reply all
Reply to author
Forward
0 new messages