Comingle provides an API to let you query and manipulate Comingle meetings, rooms, tabs, and logs from your own software.
Queries can run without any special permissions, just like they would in the browser. For safety, however, all updates require the meeting's secret key.
API operations can be HTTP GET or POST requests on the Comingle server, on
the path /api
followed by the operation name (see below).
Operation parameters can be specified in two different ways, or a mixture thereof:
- The request body can contain an
EJSON-encoded (seel below)
object with key/value pairs specifying parameters.
In this case, you must also provide the header
Content-Type: application/json
so that the body can be decoded. - The query URL can have a
query string
specifying key/value pairs as parameters.
Values should generally be
EJSON-encoded,
but for ease of use you can also use these special cases:
- Meteor-style 17-character IDs (used a lot by the API) can be included without quotes.
- ECMAScript Date/Time Strings (with at least a year and month)
- You can use both a request body and URL query parameters to provide a mixture of keys. If the same key is present in both, the URL query parameter takes precedence.
EJSON is an extension of JSON that in
particular has support for Date
s and RegExp
s needed by some API operations:
- A
Date
d
is encoded as{"$date":d.getTime()}
whered.getTime()
is the number of milliseconds since Unix epoch in UTC. - The
RegExp
/[a-z]/i
is encoded as{"$regexp":"[a-z]","$flags":"i"}
.
If you're not using Date
s or RegExp
s in your API operations, you can use a
regular JSON encoder.
Also, in queries involving dates, you can use
ECMAScript Date/Time Strings
(with at least a year and a month)
as an alternative to the EJSON encoding of Date
s.
But the output (e.g. updated
field) will still use EJSON encoding.
If you're writing a JavaScript app outside of the Meteor framework, you can
use the ejson
NPM module.
The response consists of an EJSON-encoded object with the following fields:
ok
:true
orfalse
according to whether the operation succeeded.error
: Whenok
isfalse
, a human-readable string error message.errorCode
: Whenok
isfalse
, sometimes contains a computer-readable string error code.meetings
,rooms
,tabs
,logs
: Whenok
istrue
, sometimes contain arrays of matching meetings/rooms/tabs/logs, depending on the operation.
Responses often include "presence" objects which consist of two fields:
name
(string): Name of user (defaulting to"API"
for API operations)presenceId
(string): Unique ID for that user/browser tab (defaulting to"API"
for API operations)
For consistency with other API calls, query operations can specify an
updator
field, which is ignored.
Request fields: (either meeting
or meetings
is required)
meeting
(corequired string): ID of meeting to fetchmeetings
(corequired array of strings): Array of IDs of meetings to fetch
Response fields (when ok
is true
):
meetings
: Array of meeting details (excludingsecret
s), each including:_id
(string): Meeting IDtitle
(string): Meeting titlecreator
(presence): Who created the meetingcreated
(date): When the meeting was createdupdator
(presence): Who last updated the meetingupdated
(date): When the meeting was last updated
Request fields: (either room
or rooms
or meeting
is required)
room
(corequired string): ID of room to fetchrooms
(corequired array of strings): Array of IDs of rooms to fetchmeeting
(corequired string): ID of meeting to fetch all rooms from (unlessroom
orrooms
is specified)secret
(optional string): The meeting secrettitle
(optional string or regexp): Restrict to rooms with matching titleraised
(optional boolean): Restrict to rooms with(out) raised handarchived
(optional boolean): Restrict to rooms that are (not) archivedlocked
(optional boolean): Restrict to rooms that are (not) lockedprotected
(optional boolean): Restrict to rooms that are (not) protecteddeleted
(optional boolean): Restrict to rooms that are (not) deleted (works only with meetingsecret
)
The meeting secret
can be specified in combination with meeting
or room
.
In this case, it allows searching for deleted rooms via deleted: true
, or
finding both deleted and undeleted rooms via unspecified deleted
.
(If you do not want to return deleted rooms, use deleted: false
or
don't specify secret
.)
Response fields (when ok
is true
):
rooms
: Array of room details, each including:_id
(string): Room IDtitle
(string): Room titlecreator
(presence): Who created the roomcreated
(date): When the room was createdupdator
(presence): Who last updated the roomupdated
(date): When the room was last updatedraised
(date or null): When the hand was raised, ornull
/absent if notraiser
(presence): Who last raised the handarchived
(date or null): When the room was archived, ornull
/absent if notarchiver
(presence): Who last archived the roomlocked
(date or null): When the room was locked, ornull
/absent if notlocker
(presence): Who last locked the roomprotected
(date or null): When the room was protected, ornull
/absent if notprotecter
(presence): Who last protected the roomdeleted
(date or null): When the room was deleted, ornull
/absent if notdeleter
(presence): Who last deleted the roomjoined
(array of presences): Array of who is currently in the roomadminVisit
(date or boolean): When the room was last visited by an admin, ortrue
if the room has an admin now, orfalse
if the room is currently empty
Request fields:
(either tab
or tabs
or room
or rooms
or meeting
is required)
tab
(corequired string): ID of tab to fetchtabs
(corequired array of strings): Array of IDs of tabs to fetchroom
(corequired string): ID of room to fetch all tabs from (unlesstab
ortabs
is specified)rooms
(corequired array of strings): Array of IDs of rooms to fetch all tabs from (unlesstab
ortabs
is specified)meeting
(corequired string): ID of meeting to fetch all tabs from (unlessroom
orrooms
ortab
ortabs
is specified)secret
(optional string): The meeting secrettype
(optional string or regexp): Restrict to tabs with matching typetitle
(optional string or regexp): Restrict to tabs with matching titleurl
(optional string or regexp): Restrict to tabs with matching URLarchived
(optional boolean): Restrict to tabs that are (not) archiveddeleted
(optional boolean): Restrict to tabs that are (not) deleted (works only with meetingsecret
)
The meeting secret
can be specified in combination with meeting
or tab
.
In this case, it allows searching for deleted tabs via deleted: true
, or
finding both deleted and undeleted tabs via unspecified deleted
.
(If you do not want to return deleted tabs, use deleted: false
or
don't specify secret
.)
Response fields (when ok
is true
):
tabs
: Array of tab details, each including:_id
(string): Tab IDtype
(string): Tab type, one of:"iframe"
: General web page"cocreate"
: Cocreate whiteboard"jitsi"
: Jitsi Meet video call"youtube"
: YouTube video"zoom"
: Zoom video call
title
(string): Tab titleurl
(string): Tab URLcreator
(presence): Who created the tabcreated
(date): When the tab was createdupdator
(presence): Who last updated the tabupdated
(date): When the tab was last updatedarchived
(date or null): When the tab was archived, ornull
/absent if notarchiver
(presence): Who last archived the tabdeleted
(date or null): When the tab was deleted, ornull
/absent if notdeleter
(presence): Who last deleted the tab
Request fields:
meeting
(required string): ID of meeting to get logs forsecret
(required string): The meeting secretstart
(optional date): Restrict to logs ≥ this dateend
orfinish
(optional date): Restrict to logs ≤ this date
Response fields (when ok
is true
):
logs
: Array of logs sorted byupdated
, each including:updated
(date): When the logged event occurredtype
(string): Type of logged event, one of:"presenceJoin"
: User newly joined the meeting; all presence fields included"presenceUpdate"
: User updated their presence information; changed presence fields included"presencePulse"
: User connected for a set interval (default 4 hours); all presence fields included"presenceLeave"
: User left meeting; no presence fields included
id
(optional string): Presence IDname
(optional string): Name of userrooms
(optional object):joined
(optional array of strings): Array of IDs of rooms that the user has joined (typically length 1)starred
(optional array of strings): Array of IDs of rooms that the user has starred
To look at presence within an interval [a, b], it suffices to fetch all logs
in the interval [a − pulseFrequency
, b] where pulseFrequency
(defined in server/presence.coffee
)
defaults to 4 hours. Then you're guaranteed to see either a
"presenceJoin"
or "presencePulse"
event for every user that joined before
time a, giving you their full presence information,
possibly followed by "presenceUpdate"
diffs.
All edit and create operations support the following request fields:
secret
(required string): The meeting secretupdator
(optional): String for name of updator (defaults to"API"
), or an object with keysname
andpresenceId
(as used by the web interface)
Request fields (in addition to secret
and updator
described above):
meeting
(required string): ID of meeting to modifytitle
(optional string): New title for meeting
Response fields (when ok
is true
):
meetings
: Array containing the updated meeting
Request fields (in addition to secret
and updator
described above):
room
(corequired string): ID of room to modifyrooms
(corequired object or array of strings): Array of IDs of rooms to modify, or a query object like/api/room/get
(e.g.{"meeting": ...}
)title
(optional string): New title for room(s)raised
(optional boolean): New raised-hand state for room(s)archived
(optional boolean): New archived state for room(s)deleted
(optional boolean): New deleted state for room(s)locked
(optional boolean): New locked state for room(s)protected
(optional boolean): New protected state for room(s)
For example, the following query object matches all unprotected unarchived rooms and sets them to archived:
{
"rooms": {
"meeting": ...,
"protected": false,
"archived": false
},
"archived": true,
"secret": ...,
"updator": "Auto archive"
}
Response fields (when ok
is true
):
rooms
: Array containing the updated rooms
Request fields (in addition to secret
and updator
described above):
tab
(corequired string): ID of tab to modifytabs
(corequired object or array of strings): Array of IDs of tabs to modify, or a query object like/api/tab/get
(e.g.{"meeting": ...}
)title
(optional string): New title for tab(s)archived
(optional boolean): New archived state for tab(s)deleted
(optional boolean): New deleted state for tab(s)
Response fields (when ok
is true
):
tabs
: Array containing the updated tabs
All create operations except
/api/meeting/new
require secret
,
and all create operations support updator
request fields.
See Edit Operations for their description.
Request fields (in addition to updator
described above):
title
(optional string): Title for new meeting
Request fields (in addition to secret
and updator
described above):
meeting
(required string): ID of meeting to add room totitle
(optional string): Title for new roomarchived
(optional boolean): Whether new room should be archivedlocked
(optional boolean): Whether new room should be lockedprotected
(optional boolean): Whether new room should be protectedtabs
(optional array of objects): Initial tabs to create within room. Each object should have the same fields as in/api/tab/new
, excludingmeeting
,room
,secret
, andupdator
.
Request fields (in addition to secret
and updator
described above):
meeting
(required string): ID of meeting to add tab toroom
(required string): ID of room to add tab totype
(optional string): Tab type as defined in/api/tab/get
, defaulting to a guessed value based onurl
title
(optional string): Title of new tab, defaulting to a value based onurl
url
(optional string): URL of new tab, defaulting to a newly created Cocreate room (whentype
is"cocreate"
) or Jitsi video call (whentype
is"jitsi"
)archived
(optional boolean): Whether new tab should be archived