如何为日历/日历事件创建通知-Domino API

时间:2019-07-17 10:04:19

标签: lotus-notes lotus-domino

我正在尝试使用Domino API 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

我已经尝试了几件事,下面是创建具有noticetype日历事件的示例帖子请求

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

请求正文:

{
  "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"
      }
    }
  ]
}

在响应中,notificationtype获得的是“ A”标签,而不是I,我既无法创建通知,也无法创建邀请

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

发送通知列表。但响应是200没空

邀请也引发了空的回应。

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

1 个答案:

答案 0 :(得分:0)

我刚刚发布了以下JSON正文,它可以在我的环境中工作:

{
  "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": "clowe@peaks.com"
        }
      ],
      "organizer": {
        "email": "jdodge@peaks.com"
      }
    }
  ]
}

“工作”是指在主席的日历(jdodge@peaks.com)上创建会议,并自动向与会者发送邀请(clowe@peaks.com)。

一些关键点:

  • 我将JSON发布到了主席的事件资源上-在我的情况下为/mail/jdodge.nsf/api/calendar/eventsorganizer对象中的电子邮件地址必须与邮件文件(/mail/jdodge.nsf)的所有者匹配。如果组织者的电子邮件地址不正确,则API将创建约会而不是会议。
  • scheduleMethod属性是不必要的。您正在创建会议;没有通知。 API会根据需要自动生成通知。
  • 我删除了所有x-lotus属性。通常,它们是只读的。它们可能在API的输出中很有用,但在输入时会被忽略。