Create and update meetings

Note: See the sample files XMLApiAdapter.java and SCO.java.

You might also want to allow users to create meetings in your application. To create a meeting, call sco-update with the folder-id of a meetings folder and type=meeting :

https://example.com/api/xml?action=sco-update 
    &folder-id=2006258750&description=For all company employees 
    &name=Company All Hands Meeting&type=meeting&lang=en 
    &date-begin=2006-06-16T23:00&date-end=2006-06-16T23:30

The response returns the sco-id of the meeting, which you can extract and store:

<sco account-id="624520" disabled="" display-seq="0" folder-id="2006258750" icon="meeting" lang="en" max-retries="" sco-id="2006743452"  
    source-sco-id="-1625529" type="meeting" version="1">

The difference between calling sco-update to create or update a meeting is:

  • Pass a folder-id to create a meeting.

  • Pass a sco-id to update an existing meeting. A meeting only has a sco-id if it already exists.

Create a meeting

In an application, you first need to collect from the user the information needed to create or update the meeting, such as the meeting name, date, time, and so on. With that information, use a method such as updateSco that calls the sco-update action.

In sco-update , be sure to set the type of the SCO to meeting . As an option, you can also set a language code for the meeting room, such as lang=en , for example:

https://example.com/api/xml?action=sco-update&folder-id=2006258750 
    &description=nov&name=Nov%20All%20Hands%20Meeting&type=meeting&lang=en 
    &date-begin=2006-11-11T09:00&date-end=2006-11-11T17:00

The updateSCO method shows how to implement the sco-update call in Java, once you collect information about the meeting from the user:

public String updateSCO(String action, SCO sco) throws XMLApiException { 
        try { 
            StringBuffer sb = new StringBuffer(); 
            Map data = sco.getUpdateFields(); 
 
            if (CREATE.equals(action)) 
                sb.append("folder-id=" + sco.getFolderId()); 
            else 
                sb.append("sco-id=" + sco.getId()); 
            Iterator iter = data.keySet().iterator(); 
            while (iter.hasNext()) { 
                String key = (String) iter.next(); 
                if (key.indexOf("sco-id") != -1) 
                    continue; 
                if (key.indexOf("folder-id") != -1) 
                    continue; 
                String value = (String) data.get(key); 
                sb.append("&" + key + "=" + value); 
            } 
            if (null == data.get("type")) 
                throw new XMLApiException("SCO type not defined"); 
            Element e = request("sco-update", sb.toString()); 
            XPath scoId = XPath.newInstance("//results/sco/@sco-id"); 
            if (scoId.valueOf(e) == null) 
                return null; 
            else 
                return scoId.valueOf(e); 
        } catch (JDOMException jde) { 
            throw new XMLApiException(PARSE_ERROR, jde); 
        } catch (ParseException pe) { 
            throw new XMLApiException(PARSE_ERROR, pe); 
    } 
} 

Set meeting access

Once you have a sco-id , a meeting needs access. The user who creates the meeting is the host by default and chooses whether the meeting is public or private, set by a combination of permission-id and principal-id in permissions-update . For example, this call makes a meeting public:

https://example.com/api/xml?action=permissions-update&acl-id=2006334033 
    &principal-id=public-access&permission-id=view-hidden

Once a user chooses these values, the setPermissions method calls permissions-update to set the meeting access:

public void setPermissions(String aclId, String principalId, 
        String permissionId) throws XMLApiException { 
    request("permissions-update", "acl-id=" + aclId + "&principal-id=" 
         + principalId + "&permission-id=" + permissionId); 
}

// Ethnio survey code removed