Bookker API Documentation logo Bookker API Documentation

Creación de reserva estándar de espacio

Última modificación: 21/05/2025

Intenta crear una / o varias reservas en el recurso elegido.

Las reservas solo se crearán si se pueden realizar todas con éxito, en el momento en el que falle una el resto no se tendrá en cuenta.

Reserva en lote

Ahora se puede elegir si las reservas se deben crear en lote o no. Es decir, que si falla una reserva no se debe crear ninguna del lote. Esto se indica a través del parámetro “inBatch” que por defecto tiene valor true.

Acceso al edificio

Dentro de la información de la reserva hay un campo llamado “buildingAccessStatus”, que indica si se ha concedido al usuario acceso al edificio para esa reserva.

Este campo tiene tres posibles valores:

¡IMPORTANTE!

Es importante que si se trata de una reserva de espacios de trabajo se añada la cabecera "user-access-token" con el token de acceso de Microsoft del usuario (en caso de estar logueado en Microsoft).

Request

HTTP request
POST /api/v2/spacebookings
Headers
Header Value Required
Authorization Bearer eyJ0eXBlIjoiSldUIiwiYWxnIjoiSFM1MT… true
user-access-token aZJ0eXBl0sdSldUIiwiYKsnIjoiSFM1MT… false
Body

En el cuerpo de la solicitud, proporcione una representación JSON del siguiente objeto:

{
    "resourceId": "458337df-0a17-4349-903c-4f250b9de717",
    "bookingDays": [
        {
            "startDate": 1701243000000,
            "endDate": 1701246600000
        },
        {
            "startDate": 1701329400000,
            "endDate": 1701333000000
        },
        {
            "startDate": 1701415800000,
            "endDate": 1701419400000
        }
    ],
    "organizerId": "845959a8-e778-4d2b-8f1b-7abd377ee462",
    "importance": "NORMAL",
    "subject": "Prueba llamada creacion",
    "body": {
        "content": "This is the schedule for the team meeting."
    },
    "internalAttendees": [
       {
            "userId": "325959a8-e778-4d2b-8f1b-7abd377ee321",
            "type": "REQUIRED"
       }
    ],
    "externalAttendees": [
       {
            "email": "invitado.externo@prueba.com",
            "type": "OPTIONAL"
       }
    ],
    "createOnlineMeeting": false,
    "sipAddress": "",
    "inBatch": true // Por defecto su valor es true
}

Response

Si se han conseguido crear las reservas, se devuelve un código 201 con la información de las mismas.

Body
{
    "bookings": [
{
    "id": "56baeb5a-93ef-4f24-927f-575a065461db",
    "startDate": 1667120400000,
    "endDate": 1667124000000,
    "duration": 3600000,
    "status": "PENDING",
    "accessControl": {
        "accessControlType": "ANY"
    },
    "creator": {
        "id": "304a9cba-ad72-49a1-8782-9ac9a36cd8e7",
        "name": "Aitor",
        "surname": "Jupiter",
        "upn": "a@bookker.es",
        "email": "txoflas@gmail.com",
        "userRuleId": "c796bc2d-e000-4d07-b5da-4d334d66a770",
        "organizationId": "8aee218a-fce2-4900-9410-00f485a2729e",
        "mobileRoleId": "1dfde059-da65-49c9-8db3-dccc4f3292e4",
        "canBeSearched": false,
        "timezone": "Europe/Madrid",
        "language": "es",
        "acceptedBookkerPolicy": true,
        "acceptedCustomPolicy": true,
        "status": "ACTIVATED"
    },
    "organizer": {
        "id": "304a9cba-ad72-49a1-8782-9ac9a36cd8e7",
        "name": "Aitor",
        "surname": "Jupiter",
        "upn": "a@bookker.es",
        "email": "txoflas@gmail.com",
        "userRuleId": "c796bc2d-e000-4d07-b5da-4d334d66a770",
        "organizationId": "8aee218a-fce2-4900-9410-00f485a2729e",
        "mobileRoleId": "1dfde059-da65-49c9-8db3-dccc4f3292e4",
        "canBeSearched": false,
        "timezone": "Europe/Madrid",
        "language": "es",
        "acceptedBookkerPolicy": true,
        "acceptedCustomPolicy": true,
        "status": "ACTIVATED"
    },
    "resource": {
        "id": "3cbebe9a-512a-4f32-b805-7275bbaef0ca",
        "name": "SALA 102",
        "posterCode": "14MAY-P1-SALA-102",
        "organizationId": "8aee218a-fce2-4900-9410-00f485a2729e",
        "status": "ACTIVATED",
        "subcategory": {
            "id": "072ac366-1c4f-4995-af07-1a111f8fcc12",
            "name": "Sala de reuniones",
            "category": "SPACE"
        },
        "building": {
            "id": "9f7868b3-c276-494c-aa34-c8ca7967ee7f",
            "name": "Edificio 14 MAYO",
            "organizationId": "8aee218a-fce2-4900-9410-00f485a2729e",
            "status": "ACTIVATED",
            "visible": true,
            "timezone": "Etc/UTC"
        },
        "floor": {
            "id": "0b85c0f9-4fbc-4263-ad5c-b1e2ef0da118",
            "name": "Planta 1",
            "visible": true,
            "status": "ACTIVATED"
        },
        "group": {
            "id": "68d7e3d4-4a1f-472f-8354-ebe4682791b2"
        },
        "approachable": false,
        "visible": true,
        "capacity": 24
    },
    "buildingAccessStatus": "PENDING",
    "createdDate": 1666774385000,
    "createdBy": "304a9cba-ad72-49a1-8782-9ac9a36cd8e7",
    "lastModifiedDate": 1666774835000,
    "lastModifiedBy": "304a9cba-ad72-49a1-8782-9ac9a36cd8e7",
    "resourceType": "SPACE",
    "subject": "Nuevo título 2",
    "body": {
        "content": "Esta es la nueva descripción 2",
        "bodyType": "TEXT"
    },
    "importance": "LOW",
    "attendees": [
        {
            "id": "11935255-2908-49d2-97d1-45971cfa0726",
            "type": "OPTIONAL",
            "status": "NEEDS_ACTION",
            "bookingId": "56baeb5a-93ef-4f24-927f-575a065461db",
            "email": "aitorgilcallejo@gmail.com"
        },
        {
            "id": "57f469f1-f7b2-46ae-8600-deed927fba58",
            "type": "OPTIONAL",
            "status": "NEEDS_ACTION",
            "bookingId": "56baeb5a-93ef-4f24-927f-575a065461db",
            "user": {
                "id": "89174d56-a663-45eb-a82b-e2ce397d1e77",
                "name": "Ramón",
                "surname": "Jupiter",
                "upn": "r@bookker.es",
                "email": "ramon.jupiter@bookker.es",
                "userRuleId": "d4ae3e62-0379-408e-9485-861798285b77",
                "organizationId": "8aee218a-fce2-4900-9410-00f485a2729e",
                "mobileRoleId": "1dfde059-da65-49c9-8db3-dccc4f3292e4",
                "canBeSearched": false,
                "timezone": "Europe/Madrid",
                "language": "es",
                "acceptedBookkerPolicy": true,
                "acceptedCustomPolicy": true,
                "status": "ACTIVATED"
            }
        },
        {
            "id": "6d70c407-cea5-4561-ad93-bb76f4fa22dd",
            "type": "ORGANIZER",
            "status": "ACCEPTED",
            "bookingId": "56baeb5a-93ef-4f24-927f-575a065461db",
            "user": {
                "id": "304a9cba-ad72-49a1-8782-9ac9a36cd8e7",
                "name": "Aitor",
                "surname": "Jupiter",
                "upn": "a@bookker.es",
                "email": "txoflas@gmail.com",
                "userRuleId": "c796bc2d-e000-4d07-b5da-4d334d66a770",
                "organizationId": "8aee218a-fce2-4900-9410-00f485a2729e",
                "mobileRoleId": "1dfde059-da65-49c9-8db3-dccc4f3292e4",
                "canBeSearched": false,
                "timezone": "Europe/Madrid",
                "language": "es",
                "acceptedBookkerPolicy": true,
                "acceptedCustomPolicy": true,
                "status": "ACTIVATED"
            }
        },
        {
            "id": "8af08308-bb8e-4613-a3fe-8c9d084289cf",
            "type": "OPTIONAL",
            "status": "NEEDS_ACTION",
            "bookingId": "56baeb5a-93ef-4f24-927f-575a065461db",
            "user": {
                "id": "3f45617f-2d97-42c4-8e19-1d7b8905e139",
                "name": "Ricardo",
                "surname": "Jupiter",
                "upn": "ricardo.jupiter@bookker.es",
                "email": "ricardo.jupiter@bookker.es",
                "userRuleId": "042864eb-99bf-4572-a08a-cf1892239419",
                "organizationId": "8aee218a-fce2-4900-9410-00f485a2729e",
                "mobileRoleId": "1dfde059-da65-49c9-8db3-dccc4f3292e4",
                "canBeSearched": false,
                "timezone": "Europe/Madrid",
                "language": "es",
                "acceptedBookkerPolicy": true,
                "acceptedCustomPolicy": true,
                "status": "ACTIVATED"
            }
        }
    ],
    "allDayBooking": false
}
]
}