Professional Documents
Culture Documents
Agenda
Why REST?
REST Basics
RESTful Domino
What is REST?
Representational State Transfer (REST)
Resource-oriented:
Documents, views, messages, & calendar entries are all just resources
Benefits of REST
Secure lightweight web service based on HTTP
Great for web applications, native mobile applications and server-to-server access
REST vs SOAP
REST vs NRPC/DIIOP
Mail service
Calendar service
...
Customer
solutions using
SSJS
Customer
solutions using
REST
JS Wrappers
REST Service
Customer
solutions using
Notes Java API
Customer
solutions using
C / C++
LotusScript
Wrappers
Java Wrappers
Back-end Classes
C SDK
Core function
Customer
solutions using
LotusScript
Calendar
Service Plug-in
DAS Servlet
...
Traveler
Admin Plug-in
All components in
blue are OSGi plugins (Java code).
Client can be a
browser, native mobile
app, etc anything that
can send an HTTP
request.
11
12
GET
View Entries
http:{host}/{database}/api/data/collections/unid/{unid}
[
{
"@entryid":"1-0F7E8F76CACC9648852578110047D0C5",
"@unid":"0F7E8F76CACC9648852578110047D0C5",
"@noteid":"2C7A",
"@position":"1",
"Key":"AL",
"Name":"ALABAMA"
},
{
"@entryid":"2-DF127EF6E034AFE4852578110047D0C6",
"@unid":"DF127EF6E034AFE4852578110047D0C6",
"@noteid":"2C7E",
"@position":"2",
"Key":"AK",
"Name":"ALASKA"
},
13
14
15
GET http://{host}/{db}/api/calendar/events
JSON response
{
"events": [
{
"id": "8A3941390301436885257AD700661DAE",
"summary": "Super Bowl XLVII",
"location": "New Orleans",
"start": {
"date": "2013-02-03",
"time": "23:30:00",
"utc": true
},
"end": {
"date": "2013-02-04",
"time": "03:00:00",
"utc": true
}
},
{
"id": "09C4206D7BD743D685257AB0007BA513",
"summary": "Repeating Appointment",
"location": "test",
"start": {...},
"end": {...}
}, ...
]
}
16
GET http://{host}/{db}/api/calendar/events?format=icalendar
iCalendar response
BEGIN:VCALENDAR
X-LOTUS-CHARSET:UTF-8
VERSION:2.0
BEGIN:VEVENT
DTSTART:20130203T233000Z
DTEND:20130204T030000Z
SUMMARY:Super Bowl XLVII
LOCATION:New Orleans
UID:8A3941390301436885257AD700661DAE
X-LOTUS-SUMMARYDATAONLY:TRUE
END:VEVENT
BEGIN:VEVENT
DTSTART:20130205T140000Z
DTEND:20130205T150000Z
SUMMARY:Repeating Appointment
LOCATION:test
UID:09C4206D7BD743D685257AB0007BA513
X-LOTUS-SUMMARYDATAONLY:TRUE
END:VEVENT
...
END:VCALENDAR
17
POST http://{host}/{db}/api/calendar/events
Content-Type: application/json
JSON request
{
"events": [
{
"summary": "2013 Boston Marathon",
"location": "Hopkinton to Boston",
"start": {
"date": "2013-04-15",
"time": "13:00:00",
"utc": true
},
"end": {
"date": "2013-04-15",
"time": "19:00:00",
"utc": true
}
}
]
}
18
POST http://{host}/{db}/api/calendar/events
Content-Type: text/calendar
iCalendar request
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//Some Company//NONSGML Some Product//EN
BEGIN:VEVENT
DTSTART:20130415T130000Z
DTEND:20130415T190000Z
SUMMARY:2013 Boston Marathon
LOCATION:Hopkinton to Boston
END:VEVENT
END:VCALENDAR
19
20
GET
Inbox
http:{host}/{database}/api/mail/inbox
[
{
"from":"Dan Misawa",
"subject":"Test sending mail...",
"date":"2011-10-13T17:52:09Z",
"href":"http:\/\/ibm.com\/mail\/dmisawa.nsf\/api\/mail\/messages\/969862CC4FF167B18525792..."
},
{
"from":"Frank Adams",
"subject":"Email with Mime",
"date":"2011-10-17T17:16:55Z",
"href":"http:\/\/ibm.com\/mail\/dmisawa.nsf\/api\/mail\/messages\/D6BAC6EE639E5C278525792..."
},
{
"from":"Betty Zechman",
"subject":"Message with rich text conent and attachment.",
"date":"2011-12-09T18:35:43Z",
"href":"http:\/\/ibm.com\/mail\/dmisawa.nsf\/api\/mail\/messages\/D02D492E423DBF5F85257961..."
}
]
21
GET
Messages
http:{host}/{database}/api/mail/messages/{UNID}
{
"from":"CN=fadams\/O=Renovations",
"to": ["CN=Dan Misawa \/O=Renovations"],
"subject":"Message with rich text conent and attachment.",
"date":"2011-12-09T19:42:49Z",
"href":"http:\/\ibm.com\/mail\/dlawson.nsf\/api\/mail\/messages\/D02D492E423DBF5F85257961006C242C",
"content": [
{
"contentType":"multipart\/mixed; boundary=\"=_mixed 006C4A7C85257961_=\""
},
{
"contentType":"text\/html; charset=\"US-ASCII\"",
"data":"<font size=2 color=red face=\"sans-serif\"><b>This text is bold and red.<\/b><\/font>\r\n<br>\r\n<br>",
"boundary":"--=_mixed 006C4A7C85257961_="
},
{
"contentType":"text\/plain; name=\"Text Document.txt\"",
"contentTransferEncoding":"quoted-printable",
"data":"This is a simple text file with some text.=\r\n=",
"boundary":"--=_mixed 006C4A7C85257961_=",
"contentDisposition":"attachment; filename=\"Text Document.txt\""
}
]
}
22
GET
Messages
http:{host}/{database}/api/mail/messages/{UNID}?format=mime
MIME-Version: 1.0
To: Dan Misawa@notesdev.ibm.com
Subject: Message with rich text conent and attachment.
Message-ID: <OFD02D492E.423DBF5F-ON85257961.006C242C-85257961.006C4A7F@LocalDomain>
Date: Fri, 9 Dec 2011 14:42:49 -0500
Sender: fadams@explorer.swg.usma.ibm.com
From: fadams@notesdev.ibm.com
Content-Type: multipart/mixed; boundary="=_mixed 006C4A7C85257961_="
MIME-Version: 1.0
--=_mixed 006C4A7C85257961_=
Content-Type: text/html; charset="US-ASCII"
<font size=2 color=red face="sans-serif"><b>This text is bold and red.</b></font>
<br>
--=_mixed 006C4A7C85257961_=
Content-Type: text/plain; name="Text Document.txt"
Content-Disposition: attachment; filename="Text Document.txt"
Content-Transfer-Encoding: quoted-printable
This is a simple text file with some text.=
=
--=_mixed 006C4A7C85257961_=--
23
24
FreeBusy
Traveler admin
Can be enabled for Server, Database (View and Document), and View
{
"code":403,
"text":"Forbidden",
"message":"Database not allowed for Web Access"
}
Internet Site
or Server
Document
25
Database
Advanced
Properties
26
Tools to build your own services using OSGi and Apache Wink
Java, OSGi, Wink skills required
27
User story (1 of 3)
Data service : Document Repository
User story
User want to read/write document in domino server on mobile or web browser
Pro-art and limitation
Xpages,Help documents on Lotus wiki are implemented by xpage, Xpages is developed
and binding with db.
Solution
After we public RESTful service, any vendor or partner can develop client application
product or integrate this service into their product
User story (2 of 3)
Mail service : Social mail/Connection mail
User story
User want to read his mail on mobile or web browser
Pro-art and limitation
iNotes, use internal domino api instead of consume REST mail service. Additional library
needed on server.
Solution
REST API is standard and general service, independent of client/server, after we provide
mail service api, all kinds of web-based mail client can consume it , integrate it, including
next generation notes client- Social mail
User story (3 of 3)
Calendar service : General calendar
User story
User want to check his calendar on mobile, this calendar is collection for all his calendar
events, including google calendar, notes calendar, iCalendar on mac
Pro-art and limitation
N/A
Solution
After we public RESTful service, any vendor or partner can develop client application
product or integrate this service into their product
APIs by Release
API Name
31
8.5.3 Upgrade
Pack 1
Extension
Library
(OpenNTF)
9.0 Social
Edition
9.x
Yes
Yes
In Plan
In Plan
Calendar service
No
No
No
In Plan
Mail service
No
Yes
No
Not in Plan
Source
Link
http://www-10.lotus.com/ldd/ddwiki.nsf/xpViewCategories.xsp?
lookupName=Domino%20Data%20Service
Mail service
OpenNTF
http://www.openntf.org/Projects/pmt.nsf/E1B347B6A993144186257
AC6005577F2/%24file/Domino%20Mail%20Service.pdf
Planned for an extlib release coming soon (http://extlib.openntf.org/)
Calendar service
32
Domino application
development in general
http://www-10.lotus.com/ldd/ddwiki.nsf
OpenNTF
http://extlib.openntf.org/