From 1a0e2031d2271e4eeb04efee8e6d7ebfe8732d4d Mon Sep 17 00:00:00 2001 From: Raphael Michel Date: Wed, 25 Apr 2018 16:02:07 +0200 Subject: [PATCH] Add check-in capabilities to official RESTful API (#884) * Add check-in capabilities to official RESTful API * Add deprecation note --- doc/api/resources/checkinlists.rst | 130 ++++++++++++++++- doc/plugins/pretixdroid.rst | 8 +- doc/spelling_wordlist.txt | 1 + src/pretix/api/views/checkin.py | 57 ++++++++ src/tests/api/test_checkin.py | 219 +++++++++++++++++++++++++++++ 5 files changed, 409 insertions(+), 6 deletions(-) diff --git a/doc/api/resources/checkinlists.rst b/doc/api/resources/checkinlists.rst index af55db676..0c044b639 100644 --- a/doc/api/resources/checkinlists.rst +++ b/doc/api/resources/checkinlists.rst @@ -330,6 +330,8 @@ Order position endpoints ``order__status__in``, ``subevent__in``, ``addon_to__in``, and ``search``. The search for attendee names and order codes is now case-insensitive. + The ``.../redeem/`` endpoint has been added. + .. http:get:: /api/v1/organizers/(organizer)/events/(event)/checkinlists/(list)/positions/ Returns a list of all order positions within a given event. The result is the same as @@ -427,7 +429,7 @@ Order position endpoints :statuscode 403: The requested organizer/event does not exist **or** you have no permission to view this resource. :statuscode 404: The requested check-in list does not exist. -.. http:get:: /api/v1/organizers/(organizer)/events/(event)/checkinlists/(list)/positions/(id) +.. http:get:: /api/v1/organizers/(organizer)/events/(event)/checkinlists/(list)/positions/(id)/ Returns information on one order position, identified by its internal ID. The result format is the same as the :ref:`order-position-resource`, with one important difference: the @@ -437,7 +439,7 @@ Order position endpoints .. sourcecode:: http - GET /api/v1/organizers/bigevents/events/sampleconf/checkinlists/1/positions/ HTTP/1.1 + GET /api/v1/organizers/bigevents/events/sampleconf/checkinlists/1/positions/23442/ HTTP/1.1 Host: pretix.eu Accept: application/json, text/javascript @@ -494,3 +496,127 @@ Order position endpoints :statuscode 401: Authentication failure :statuscode 403: The requested organizer/event does not exist **or** you have no permission to view this resource. :statuscode 404: The requested order position or check-in list does not exist. + +.. http:post:: /api/v1/organizers/(organizer)/events/(event)/checkinlists/(list)/positions/(id)/redeem/ + + Tries to redeem an order position, identified by its internal ID, i.e. checks the attendee in. This endpoint + accepts a number of optional requests in the body. + + :