question.ticket_classes

64 views
Skip to first unread message

alan....@business50.uk

unread,
Jul 27, 2017, 5:12:58 PM7/27/17
to Eventbrite API

I am looking for some guidance? The documentation is very poor in describing this (question.ticket_classes) element of event "questions" (why do they call them that - I would call them fields!).

I have found a reference to this field having a syntax of: [{"id":"1234"},{"id":"4567"}]. Can anyone tell me what these parameters are?

I am wanting to post some additional "questions" with information to be gathered when a specific ticket (class) is purchased and this would seem the be the way to do it?

I am not even sure when they give the path as "/events/:id/questions/:id/", what the ID's in question are?

Thanks for any pointers.

Regards
Alan

Hernán Cussi

unread,
Jul 28, 2017, 8:29:08 PM7/28/17
to Eventbrite API
Hello there, I will try to help you out with this.

In the eventbrite organizer site, www.eventbrite.com, you could create an event with different questions in the Manage Section of your event in the Order Form option for Each Attendee/Buyer.
So, ideally you could ask to each buyer/attendee, "Which is your favourite band?", and then provide possible answers or provide a text box, etc. And then you could specify optionally to only apply to an specific ticket/s and some other options.

So, back to the matter in hand, question.ticket_classes will contain an array of all the tickets which this question should be shown in the checkout, in the format that you described where the id is the ticket class id, you could use the SOA explorer to test this out: https://www.eventbriteapi.com/v3/events/event_id/questions/?token=TOKEN, so, yes, that's the right way to go.

So, basically to create a new question using the API you will do a POST to https://www.eventbriteapi.com/v3/events/event_id/questions/?token=TOKEN, after the resource (question) is created it will return in the response the question just created, and you will have an id for that resource. So, later you could get that using https://www.eventbriteapi.com/v3/events/event_id/questions/question_id/?token=TOKEN and that will return something like:
        {
            "resource_uri": "https://www.eventbriteapi.com/v3/events/36620871011/questions/16014860/", 
            "id": "16014860", 
            ... // *way more data here
            "ticket_classes": [
                {
                    "id": "70200406", 
                    "name": "VIP"
                }
            ], 
            "respondent": "ticket_buyer"
        }
Thanks

Hernán Cussi

unread,
Jul 31, 2017, 2:25:28 PM7/31/17
to Eventbrite API
To make this more clear, let me show you an example:

event_id: 36620871011
ticket_class_id: 70200406

To create a question for a particular event, for a particular ticket in the event:


{
"question": {
"question": {
"html": "What is your favourite colour?"
},
"required": false,
"type": "text",
"respondent":"ticket_buyer",
"ticket_classes": [{"id":"70200406"}]
}
}

And then will return as the response:

{
    "id": "16026741",
    "question": {
        "text": "What is your favourite colour?",
        "html": "What is your favourite colour?"
    },
    "type": "text",
    "required": false,
    "choices": [],
    "ticket_classes": [
        {
            "id": "70200406",
            "name": "Campo"
        }
    ],
    "include": true,
    "status": "Active",
    "respondent": "ticket_buyer"
}

Where:
event_id: 36620871011
questions_id: 16026741
ticket_class_id: 70200406

I can not make this more clear, if you have more questions, please post here. Thanks

Alan....@business50.uk

unread,
Aug 1, 2017, 6:38:24 AM8/1/17
to Eventbrite API
Hernan,
Your examples exemplify my confusion!
1) What is the value 'name'. What is it for? Is it necessary and what does it mean? In your example you POST a question with no 'name', but the value returned from the GET has one ("name": "Campo"). I cannot see its purpose or where it came from?
2) Where does the ticket class ID come from and what is it used for?
Thanks
Alan

Hernán Cussi

unread,
Aug 4, 2017, 3:11:33 AM8/4/17
to Eventbrite API
Hey Alan, 

1) True, you should NOT send this in the request, but you will get it in the response. Name is the ticket name basically. So, if you have an event with one paid ticket called VIP, you will get VIP, cristal clear right? Agree that it might be confusing, but, just don't send it.
2) Ok, that's a good question, so, you will need to get more familiar with our API: https://www.eventbrite.com/developer/v3/quickstart/
Basically you will need to use: https://www.eventbrite.com/developer/v3/endpoints/events/#ebapi-get-events-id-ticket-classes
In my example, that will be:
GET https://www.evbqaapi.com/v3/events/36620871011/ticket_classes/?token=TOKEN
An that will return a list of ticket classes, something like:

{
    "pagination": {
        "object_count": 1,
        "page_number": 1,
        "page_size": 50,
        "page_count": 1,
        "has_more_items": false
    },
    "ticket_classes": [
        {
            "name": "Campo",
            "description": null,
            "donation": false,
            "free": true,
            "minimum_quantity": 1,
            "maximum_quantity": null,
            "maximum_quantity_per_order": 10,
            "maximum_quantity_per_order_without_pending": null,
            "on_sale_status": "AVAILABLE",
            "quantity_total": 100,
            "quantity_sold": 0,
            "sales_start": "2017-07-28T20:00:00Z",
            "sales_end": "2017-09-06T21:00:00Z",
            "hidden": false,
            "include_fee": false,
            "split_fee": false,
            "hide_description": true,
            "auto_hide": false,
            "variants": [],
            "has_pdf_ticket": true,
            "sales_channels": [
                "online",
                "atd"
            ],
            "event_id": "36620871011",
            "id": "70200406" --> This is your guy
        }
    ]
}

Thanks!

anuja...@gmail.com

unread,
Aug 29, 2017, 9:23:44 AM8/29/17
to Eventbrite API
Hi Hernán

Can you pls suggest me, how to post a ticket for the particular event.

Thanks

anuja...@gmail.com

unread,
Aug 29, 2017, 9:49:34 AM8/29/17
to Eventbrite API
Thanks

But I got the solution for that,

URL: https://www.eventbriteapi.com/v3/events/XXXXXXXXXX/ticket_classes/

and post data will be like,

{
"ticket_class":{
"name": "Test ticket",
"free": true,
"minimum_quantity": 1,
"maximum_quantity": 10,
"quantity_total": 100
}
}

Reply all
Reply to author
Forward
0 new messages