• Create an event with room reservation via Data Calendar Service API

    By Alexandru G Savu 1 decade ago

    I have managed to successfully perform CRUD operation on a calendar event resource object.
    However I am not able to create an event with a room reservation using the x-lotus-room JSON tag.

    Could you provide please a JSON object example that I can POST to the API so that I can create an event with a room reservation ?

    The JSON body that I am using and doesn't work as far as the room reservation part is concerned is :

    {
          "events":
          [
            {
              "summary": "Meeting 1 Added via API Call",
              "location": "Conference Room 2/Site@domain",
              "description": "Test description",
              "CalendarDateTime":{
                "date":"2014-02-11",
                "time":"17:00:00",
                "utc":true
              },
              "start": {
                "date":"2014-02-11",
                "time":"17:00:00",
                "utc":true
              },
              "end": {
                "date":"2014-02-11",
                "time":"17:30:00",
                "utc":true
              },
              "class":"public",
              "transparency":"opaque",
              "sequence":0,
              "x-lotus-noticetype":"I",
              "attendees": [
              {
              "displayName":"Administrator@domain",
              "email":"Administrator@domain",
                "role":"chair",
              "status":"accepted"
              },
                {
                   "displayName":"testing",
    
                  "email":"testing@domain"
                }
              ],
              "organizer": {
              "displayName":"Administrator@domain",
              "email":"Administrator@domain"
              },
              "x-lotus-room": {
                "data": "testing/TestSite@domain"
              }
            }
          ]
        }
    

    Notes :
    The Domino/LotusNotes/XPages Extension Library pair is configured OK (hopefully).
    The Reservation DB is OK, I am able to create meetings with the Lotus Client and retrieve them using api calls.

    • Don't use x-lotus-room ...

      By Dave Delay 1 decade ago

      Alexandru,

       

      When sending JSON to the calendar service (POST or PUT), you should just include the desired room in the list of attendees.  For example, see the JSON input at the bottom of this message.  I just posted that to my test server.  The calendar service created the meeting and booked the room.

       

      In my case, the room has an internet address assigned -- bos1-room1001@swg.usma.ibm.com.  If your room doesn't have an assigned internet address you can construct one from the distinguished name.  Let me know if you need help with that.

       

      Thanks.

       

      -- Dave

       

      {
      
        "timezones": [
      
          {
      
            "tzid": "Eastern",
      
            "standard": {
      
              "start": {
      
                "date": "1950-11-05",
      
                "time": "02:00:00"
      
              },
      
              "offsetFrom": "-0400",
      
              "offsetTo": "-0500",
      
              "recurrenceRule": "FREQ=YEARLY;BYMONTH=11;BYDAY=1SU;BYHOUR=2;BYMINUTE=0"
      
            },
      
            "daylight": {
      
              "start": {
      
                "date": "1950-03-12",
      
                "time": "02:00:00"
      
              },
      
              "offsetFrom": "-0500",
      
              "offsetTo": "-0400",
      
              "recurrenceRule": "FREQ=YEARLY;BYMONTH=3;BYDAY=2SU;BYHOUR=2;BYMINUTE=0"
      
            }
      
          }
      
        ],
      
        "events": [
      
          {
      
            "summary": "Meeting with a room created by the service",
      
            "description": "test",
      
            "start": {
      
              "date": "2014-02-17",
      
              "time": "14:00:00",
      
              "tzid": "Eastern"
      
            },
      
            "end": {
      
              "date": "2014-02-17",
      
              "time": "15:00:00",
      
              "tzid": "Eastern"
      
            },
      
            "attendees": [
      
              {
      
                "role": "req-participant",
      
                "status": "needs-action",
      
                "rsvp": true,
      
                "email": "DeanMelnyk@swg.usma.ibm.com"
      
              },
      
              {
      
                "role": "req-participant",
      
                "userType": "room",
      
                "status": "accepted",
      
                "rsvp": true,
      
                "email": "bos1-room1001@swg.usma.ibm.com"
      
              }
      
            ],
      
            "organizer": {
      
              "displayName": "Duke Lawson/Peaks",
      
              "email": "DukeLawson@swg.usma.ibm.com"
      
            }
      
          }
      
        ]
      
      }
      
      • By Alexandru G Savu 1 decade ago

        Hi Dave,
        Thanks for the reply.
        I managed to create a meeting based on the JSON object you provided.

        Thanks,
        Alex.

      • By Alexandru G Savu 1 decade ago

        One more question Dave : is there a way I can access all the meetings for a specific room via the XPages API ?

        Thanks,
        Alex.

        • You could use the Domino data service ...

          By Dave Delay 1 decade ago

          Alexandru,

           

          The rooms and resources database has a view (Reservations by Resource) that categorizes reservations by room.  So you could use the Domino data service to find a room and enumerate all of the reservations associated with it.  Of course you would have to enable the data service for both the database and the view.

           

          Does that help?

           

          Thanks.

           

          -- Dave

          • By Alexandru G Savu 1 decade ago

            Yes Dave, this is very useful. Thanks again!