Notification samples
Basics
On most methods you'll see parameter named "nodeId". The value of this parameter can be some valid document UUID or path.
Example of docId:
- Using UUID -> "f123a950-0329-4d62-8328-0ff500fd42db";
- Using path -> "/okm:root/logo.png"
Methods
notify
Description:
Method | Return values | Description |
---|---|---|
notify(String nodeId, List<String> users, List<String> mails, String message, boolean attachment) |
void |
Send a mail notification. |
The parameter nodeId is the UUID or PATH of the node ( document, folder, mail, or record ). The parameter users are a set of OpenKM users to be notified. The parameter mails are a set of email addresses - usually external mails - to be notified. The parameter message is the content body of the mail. When the attachment value is true the node is attached to the mail. |
Example:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.openkm.sdk4csharp;
using com.openkm.sdk4csharp.bean;
using System.IO;
namespace OKMRest
{
public class Program
{
static void Main(string[] args)
{
String host = "http://localhost:8080/OpenKM";
String username = "okmAdmin";
String password = "admin";
OKMWebservice ws = OKMWebservicesFactory.newInstance(host, username, password);
try
{
List<String> users = new List<String>();
users.Add("test");
List<String> mails = new List<String>();
mails.Add("test@none.com");
String message = "Body of the message";
ws.notify(nodeId, users, mails, message, false);
} catch (Exception e) {
System.Console.WriteLine(e.ToString());
}
}
}
}