-
Notifications
You must be signed in to change notification settings - Fork 0
tickets
The tickets endpoind is used to subscribe to an event. And creating and sending the QR code.
🚨FOR ALL TICKET ENDPOINTS AUTHENTICATION IS REQUIRED🚨
- Create a get method, so the tickets can be shown.
- Create a create method, so new tickets can be created.
- Create a remove method, so the user can unsubscribe.
- Create a
tickets/scanfor checking and accepting the tickets. - Create a
ticket/resubscribeendpoint for subscribing after a ticket is cancelled.
The get endpoints do not use any body text.
-
/api/ticketsreturns all tickets, containing an event_id. (Returns the tickets belonging to the current user)
-
[]- There are no tickets to show
200 OK - returns a JSON object with all tickets.
The post endpoints require all body data as described.
-
/api/ticketsreturns the data added to the DB.-
event_id(required, uuid, exists in the event DB, The user didn't subscribe to this event yet) - The Event id.
-
- Error is only trown when body data is incorrect. Errors are in english like the example below.
{
"message": "The given data was invalid.",
"errors": {
"event_id": [
"The event id has already been taken."
]
}
}
201 Created - returns a JSON object with the created ticket data.
The post endpoint require all body data as described.
-
/api/tickets/unsubscribe/{event_id}sets the ticket as unsubscribed.-
reason(required, string, max:191)
-
404 Not found - The requested ticket does not exist
400 Bad Request - The ticket can't be updated
401 Unauthorized - This ticket does not belong to this user
200 OK - returns a JSON object "message":"Unsubscribed".
THIS ENDPOINT IS USED IN THE APP THAT SCANS THE QR CODES
The post endpoints require all body data as described.
-
/api/tickets/scanreturns status200 - OK.-
event_id(required, uuid, exists in event table) - The ID of the current event. -
qr_data(required, string) - The data scanned from the qr code.
-
-
406 - Not Acceptable- The ticket is already scanned -
409 - Conflict- The user unsubscribed from this event
201 Created - does not return a JSON object.