I am writing a client side JS app and I am having some trouble with the REST interface to Domino server (version 8.5.3 with OSGi extension), the GET part works but I am having issues with the POST see code below. This creates a document in Domino/Notes when I click on it I get the follow messages
Note Item not found
tmpStartTime_Local : incorrect data type for operator or @Function Time/Date expected
I then tried to fill in all the “tmp” time fields this can create a document but it is not correct either. I also tried to use the “Notice” rather than appointment form again no good.
When I open the document in Notes it say it is an Agenda Item but not a meeting and also that it is recurring which it is not. It appears in “all documents” but not in the Calendar or the resource reservation. I think it is either I am not setting the correct values for an appointment document or I am not calling the correct service any ideas how to correct ?
function postREST()
{
var msg=
{
"Subject":"TEST C3",
"Body":"The date/time variant is basically just a floating-point number with the date as the integer part and the time as the fractional part. It can be freely converted back and forth to a Double, without losing information.",
"$PublicAccess":"1",
"$BusyName":"CN=Administrator/O=acme",
"$BusyPriority":"1",
"$ApprovalList":"CN=Administrator/O=acme",
"$CSFlags":"uw",
"$CSCopyItems":["Room"],
"$Programmatically": "1",
"ExcludeFromView": ["D","S" ],
"MailOptions":"0",
"AllowBusyAccess":"",
"NoticeType" : "I",
"AutoProcessType":"0",
"AutoProcessUserList":"Administrator",
"Room":"Room2\/ZAC Atalante champeaux@acme",
"AppointmentType":"3", // 0 = Appointment 3 Meeting
"Form":"Appointment",
"_ViewIcon":158, // Meeting
"Repeats":"", // doesn't appear to do much
"Chair":"CN=Administrator\/O=acme",
"Principal":"CN=Administrator\/O=acme",
"From":"CN=Administrator\/O=acme",
//"From":"CN=Administrator",
"AltChair":"CN=Administrator\/O=acme",
"SequenceNum":1,
"OrgTable":"C0", // Calendar entry 0 => first Calendar
"Logo":"StdNotesLtr25",
"StartTime":"10:00:00",
"StartDate":"2014-02-17",
"EndTime":"11:00:00",
"EndDate":"2014-02-17",
"CalendarDateTime":"2014-02-17T09:00:00Z",
"StartTimeZone":"Z=-1$DO=1$DL=3 -1 1 10 -1 1$ZX=68$ZN=Romance",
"EndTimeZone":"Z=-1$DO=1$DL=3 -1 1 10 -1 1$ZX=68$ZN=Romance",
"WhiteBoardContent":
{
"type":"multipart",
"content": [
{
"contentType":"text\/html; charset=US-ASCII",
"contentDisposition":"inline",
"data":"<html><body>HELLO WORLD<\/body><\/html>\r\n\r\n"
}
]
},
}
try {
var Amsg = JSON.stringify(msg);
}
catch (err) {
log(": Exception:"+ err);
}
var url = "http://99.99.99.99/mail/administ.nsf/api/data/documents?form=Appointment";
var username = "admin";
var password = "pwd";
try{
xhr = new XMLHttpRequest();
xhr.addEventListener("loadstart", function(evt) { //log("loadstart");log(evt);
}, false);
xhr.addEventListener("progress", function(evt)
{ //log("progress");log(evt);
}, false);
xhr.addEventListener("error", function(evt) {
error("xmlhttprequest ERROR");
log("ERROR readyState : " + this.readyState + " status : " + this.status + " " + this.statusText);
log("ERROR responseText : " + this.responseText);
log("ERROR responseXML : " + this.responseXML);
error(evt); }, false);
xhr.addEventListener("abort", function(evt) { error("abort"); error(evt); }, false);
xhr.addEventListener("load", function(evt) { //log("load");log(evt);
}, false);
xhr.addEventListener("loadend", function(evt) {
log("loadend ANSWER : readyState : " + this.readyState + " status : " + this.status);
postReturn(this.responseText);
}, false);
xhr.open("POST", url, true, username, password);
xhr.setRequestHeader("Content-Type", "application/json");
xhr.send(msg);
}
catch(err) {
log(": Exception:"+ err);
}
}