✍️Creating and Updating Attendees

In order to create and update attendees, the request needs to include a JSON array body that has at least one of the attendee objects. The objects can be of type:

For all attendees in a session, an attendee's email, and user guid(if applicable) has to be unique.

Example Request:

The request below shows the usage of all possible objects:

curl -L -X POST 'https://<DOMAIN>/xapi/v2/session/:SESSION_GUID/attendee/batch' \
--data-raw '
[
     // you can use a user_guid to insert or update, and it will parse all variables of that user to the attendee like email, mobile, and role(sending a role will override)
     // the response for this will show insert
    {
        "user_guid": "44EF7B95-81B0-419D-BB0D-DFBD545F6008"
    },
     // you can use a user_guid to insert or update, and it will parse all variables of that user to the attendee like email, mobile, and role(sending a role will override)
     // the response for this will show update
    {
        "user_guid": "7fd2b7ab-dfbe-4b35-a217-ec11791a4a80",
        "role": "a"
    },
     // a non existing user guid will get rejected
    {
        "user_guid": "7fd2b7ab-dfbe-4b35-a217-ec11791a4a8x"
    },
    // you can insert or update a user with email, name, surname and role(defaults to 'u' if not present)
    // this is the correct format to use when adding external attendees (meaning they are not registered as a user)
    // response will show insert
    {
        "email": "[email protected]",
        "name": "John",
        "surname": "Doe",
        "role": "e"
    },
    // you can insert or update a user with email, name, surname and role(defaults to 'u' if not present)
    // response will show update
    {
        "email": "[email protected]",
        "name": "updated_name",
        "surname": "Doe",
        "role": "u"
    },
    // you can update an existing attendee with its attendance_code
    {
        "attendance_code": "5786FF4C-4A93-45A2-BAF1-9461F376E8C5",
        "role": "e"
    },
    // non existent attendance_code will get rejected
    {
        "attendance_code": "2BA64ED7-EE65-4164-A0A0-85A45E8D0BFx",
        "mobile": "+00 000 00 00"
    }
]
'

Example Response:

The response for this operation includes a json object like so:

{
    "approved": [
        // JSON objects for attendee
    ],
    "rejected": [
        // JSON objects for attendee
    ]
}

Response Status Codes will vary depending on how the operations went:

  • 200 OK: All operations completed successfully

  • 207 Multi-Status: Partial success - some operations failed

  • 400 Bad Request: All operations failed

{
    "approved": [
        {
            "session_id": "70826",
            "user_id": "",
            "user_guid": "",
            "attendee_id": "503735",
            "attendance_code": "5786FF4C-4A93-45A2-BAF1-9461F376E8C5",
            "name": "non-existent",
            "surname": "non-existent",
            "email": "[email protected]",
            "role": "e",
            "mobile": null,
            "creation_date": "2024-10-18T21:39:21.575387+03:00",
            "updating_date": "2024-10-18T21:39:39.070343+03:00",
            "operation": "updated"
        },
        {
            "session_id": "70826",
            "user_id": "8208",
            "user_guid": "44EF7B95-81B0-419D-BB0D-DFBD545F6008",
            "attendee_id": "503736",
            "attendance_code": "F344309A-BA6C-4D92-9C5A-4F2EE65AFB34",
            "name": "logar",
            "surname": "komutan",
            "email": "[email protected]",
            "role": "a",
            "mobile": "",
            "creation_date": "2024-10-18T21:39:39.125758+03:00",
            "updating_date": "2024-10-18T21:39:39.125758+03:00",
            "operation": "inserted"
        },
        {
            "session_id": "70826",
            "user_id": "4490",
            "user_guid": "7fd2b7ab-dfbe-4b35-a217-ec11791a4a80",
            "attendee_id": "503725",
            "attendance_code": "D1CCAE51-7B5B-4885-A10B-8B30DFA5F014",
            "name": "Atakan",
            "surname": "Bodur",
            "email": "[email protected]",
            "role": "a",
            "mobile": "+905314237888",
            "creation_date": "2024-10-18T21:31:19.692427+03:00",
            "updating_date": "2024-10-18T21:39:39.125758+03:00",
            "operation": "updated"
        },
        {
            "session_id": "70826",
            "user_id": "0",
            "user_guid": null,
            "attendee_id": "503738",
            "attendance_code": "27A9E30B-48C3-4933-9E15-6752D686AB51",
            "name": "John",
            "surname": "Doe",
            "email": "[email protected]",
            "role": "e",
            "mobile": null,
            "creation_date": null,
            "updating_date": null,
            "operation": "inserted"
        },
        {
            "session_id": "70826",
            "user_id": "0",
            "user_guid": null,
            "attendee_id": "503726",
            "attendance_code": "C937F71E-DE23-463E-A3CE-3DCB3F36830D",
            "name": "updated_name",
            "surname": "Doe",
            "email": "[email protected]",
            "role": "u",
            "mobile": null,
            "creation_date": null,
            "updating_date": null,
            "operation": "updated"
        }
    ],
    "rejected": [
        {
            "model": {
                "session_id": "70826",
                "user_id": "",
                "user_guid": "",
                "attendee_id": "-1",
                "attendance_code": "",
                "name": null,
                "surname": null,
                "email": null,
                "role": null,
                "mobile": "+00 000 00 00",
                "creation_date": null,
                "updating_date": null,
                "operation": "error"
            },
            "state": {
                "code": 12,
                "details": "Attendee not found"
            }
        },
        {
            "model": {
                "session_id": "-1",
                "user_id": "",
                "user_guid": "7fd2b7ab-dfbe-4b35-a217-ec11791a4a8x",
                "attendee_id": "-1",
                "attendance_code": "",
                "name": null,
                "surname": null,
                "email": null,
                "role": null,
                "mobile": null,
                "creation_date": null,
                "updating_date": null,
                "operation": "error"
            },
            "state": {
                "code": 12,
                "details": "Attendee not found"
            }
        }
    ]
}

Last updated

Was this helpful?