Creates a job for registering multiple registrants to a session.
The POST /sessions/:id/people/bulk
endpoint that lets developers register multiple participants for a single event session at once is asynchronous and is based on a job scheduling mechanism. Here are the different steps:
-
First off, call the POST
/sessions/:id/people/bulk
endpoint with the list of people you want to register (with a maximum length of 50 items). The JSON payload should look like this:{ "type": "jobs", "data": { "attributes": { "tasks": [ { "attributes": { ... /* person #1 */ } }, { "attributes": { ... /* person #2 */ } } ] } } }
Please note that individual people attributes need to be the same as with the POST
/sessions/:id/people
endpoint. See the details of this endpoint here β -
Once you call this endpoint, Livestormβs API will reply with an HTTP 202 accepted response code and the following JSON response.
{ "type": "jobs", "id": "e8a0efb9-a116-4e1e-a2c2-1f9105334545", "attributes": { "status": "processing", "total_items": 127, "total_processed_items": 0, "total_fail": 0, "total_success": 0 } }
-
Later on, you can call the GET
/jobs/:id
endpoint with the ID provided in the above response. It will give you the status of your job, along with the number of items that have been βand that still needβ to be processed. The status of a job can either beprocessing
,ended
(if all tasks were successful), orfailed
(if at least one of the tasks failed). The number of successful and failed tasks will be provided in the payload. -
Once the job finishes (either successfully or with errors), the
job.ended
webhook will be triggered and will contain the same payload as in step #3 but with a different status. -
Finally, you can call the GET
/jobs/:id/tasks
to retrieve the list of registrants that needed to be created, as well as their creation status:- Items that could successfully be created will include the details of each individual registrant.
- Items that couldnβt be created will contain the error code and its error details.
Youβll receive an HTTP 207 multi-status response code and the following JSON response:
{ "data": [ { "status": "succeeded", "errors": [], "data": { ... /* people content */ } }, { "status": "failed", "errors": [ { "code": "already_registered", "message": "User already registered for this session." } ] } ], "meta": { ... /* pagination information */ } }
Hereβs a flowchart that recaps the whole process:
