1
votes

I am trying to create a calendar notice using Domino API version 9.0.1

https://www-10.lotus.com/ldd/ddwiki.nsf/xpAPIViewer.xsp?lookupName=IBM+Domino+Access+Services+9.0.1#action=openDocument&res_title=JSON_representation_of_a_notice_das901&content=apicontent

I have tried few things, below is the sample post request to create a calendar event with noticetype

POST https://{host}/{database}/api/calendar/events/

Request body:

{
  "x-lotus-charset": {
    "data": "UTF-8"
  },
  "scheduleMethod": "request",
  "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": "1x1 with Duke",
      "location": "My office",
      "description": "Status updates, etc.",
      "start": {
        "date": "2013-09-16",
        "time": "09:00:00",
        "tzid": "Eastern"
      },
      "end": {
        "date": "2013-09-16",
        "time": "10:00:00",
        "tzid": "Eastern"
      },
      "class": "public",
      "transparency": "opaque",
      "sequence": 0,
      "attendees": [
        {
          "role": "chair",
          "status": "needs-action",
          "rsvp": false,
          "displayName": "Test1 Test1",
          "email": "Test1Test1@test"
        },
        {
          "role": "req-participant",
          "status": "needs-action",
          "rsvp": true,
          "displayName": "Test1 Test1",
          "email": "Test1Test1@test"
        }
      ],
      "organizer": {
        "displayName": "Tester Tester",
        "email": "TesterTester@test"
      },
      "x-lotus-update-subject": {
        "data": "Invitation: 1x1 with Duke (Sep 16 09:00 AM EDT in My office)"
      },
      "x-lotus-broadcast": {
        "data": "FALSE"
      },
      "x-lotus-notesversion": {
        "data": "2"
      },
      "x-lotus-noticetype": {
        "data": "I"
      },
      "x-lotus-appttype": {
        "data": "3"
      },
      "x-lotus-unid": {
        "data": "someid"
      }
    }
  ]
}

In the response the noticetype gets "A" tag instead of I, I am not able to create a notice neither an Invitation

expecting GET https://{host}/{Database}/api/calendar/events/{event_id}/notices

to send the list of notices. But the response is 200 with empty body

Also the invitations are throwing empty response.

GET https://{host}/{Database}/api/calendar/invitations

1

1 Answers

0
votes

I just posted the following JSON body and it worked in my environment:

{
  "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": "1x1 with Charles",
      "location": "My office",
      "description": "Status updates, etc.",
      "start": {
        "date": "2019-09-16",
        "time": "09:00:00",
        "tzid": "Eastern"
      },
      "end": {
        "date": "2019-09-16",
        "time": "10:00:00",
        "tzid": "Eastern"
      },
      "class": "public",
      "transparency": "opaque",
      "sequence": 0,
      "attendees": [
        {
          "role": "req-participant",
          "status": "needs-action",
          "rsvp": true,
          "email": "[email protected]"
        }
      ],
      "organizer": {
        "email": "[email protected]"
      }
    }
  ]
}

By "worked" I mean it created a meeting on the chair's calendar ([email protected]) and automatically sent an invitation to the attendee ([email protected]).

Some key points:

  • I posted the JSON to the chair's events resource -- in my case /mail/jdodge.nsf/api/calendar/events. The email address in the organizer object MUST match the owner of the mail file (/mail/jdodge.nsf). If the organizer email address is not correct, the API will create an appointment instead of a meeting.
  • The scheduleMethod property is unnecessary. You are creating a meeting; not a notice. The API will automatically generate notices as necessary.
  • I removed all the x-lotus properties. Generally, those are read-only. They may be useful in the output from the API, but they are ignored on input.