An alphabetical list of methods names, their arguments, return values and the emitted events. All these method take this general pattern:
api.call('methodName', { param1: 'value', param2: 111, ... }, function(data) {
// successfull call, data is the return value
}).done(function(data) {
// you can chain multiple done calls
}).fail(function(error) {
// an error occurred
}).always(function() {
// this is called on error and on fail
})
Get a list of users that are allowed to access the forum. Only valid for private forums.
forumname
: name of the forum such as "goma"listRequested
:true
to include access requestslistAccepted
:true
to include accepted requestslistRejected
:true
to include rejected requests
Accept or deny access for a user.
username
: user's username or email addressforumname
: name of the forum such as "goma"status
: either 'accept' or 'deny'
An request to grant access to a private forum for an anonymous user.
forumname
: the name of the forum such as "goma"username
: the username or email address for the usermessage
: message for the forum admins
For example:
api.call('accessRequest', {
forumname: 'teron',
username: '[email protected]',
message: 'This is it'
}, function(data) {
// success
})
Grant access rights for users.
-
paths
: the channels that the users are granted access to. Currently only the root path (['/']
) is allowed. -
rights
: the rights that are granted. Currently only moderator right is allowed, ie:[ 'moderator' ]
.
Basically this is currently a "makeModerator" call, but we'll add more granularity later.
Remove access rights for users.
-
paths
: the channels that the users removed access from. Currently only the root path (['/']
) is allowed . -
rights
: the rights that are removed. Currently only moderator right is allowed, ie:[ 'moderator' ]
.
Returns a list of banned users on a given forum.
forumname
: the name of the forum such as "goma"
Marks the user as banned. A banned user can log in but isn't allowed to post, like or make any kind of updates to the forum.
username
: the username or email address of the banned the userbantime
: the time in seconds for how long the user will be banned
If you want to "unban" a user set the bantime
to a negative integer.
Start a new private conversation.
forumname
: the name of the forum/projectparticipants
: an array of strings, the strings being the useridbody
: a content body up to 2500 characters
Returns conversationId
List private conversations.
forumname
: the name of the forum/projectstart
: (optional) the start position to list fromcount
: (optional) the number to return
Returns array of conversations
Open a single private conversation.
forumname
: the name of the forum/projectconversationId
: the id of the conversation to openstart
: (optional) the start position to list messages from in the conversationcount
: (optional) the number to of posts to return
Returns array of posts
Block user from receiving messages.
username
: the user to hide future messages from (blocking essentially)returns
: success status
Unblock user from receiving messages.
username
: the user to unhide future messages from (unblocking essentially)
Returns success status
Mutes the conversation so that it is no longer "bumbed" on top of the list when new replies arrive and the participants won't receive any notification emails.
forumname
: the name of the forum/projectconversationId
: the id of the conversation to mute
Returns success status
Unmutes the conversation.
forumname
: the name of the forum/projectconversationId
: the id of the conversation to unmute
Returns success status
Returns a list of users whose messages are currently hidden. No params needed.
Removes a single post in private conversation
forumname
: the name of the forum/projectconversationId
: the id of the conversation to remove a post frompost
Id: the id of the post to remove in the conversation
Returns success status
Removes a private conversation
forumname
: the name of the forum/projectconversationId
: the id of the conversation to remove
Returns success status
Deletes a given thread or reply.
path
: path to the reply or thread.
You must be admin or the owner of the post (in which case the post cannot be longer than 2.7 minutes old) before you can remove posts.
A "delete" event is fired.
Unwatches all posts that the current user is following.
path
: the path of the current forum.
This method is called internally when the client is initialized. It returns all the available data for a single forum illustrated here:
path
: the mount path such as "/goma/galleries". Root path (/goma) returns all the recent posts from all channels. requiredexpand_all
: whether all threads should be expanded by default. A common setting in commenting.embedUrl
: the location where the forum is embedded. This is used on the links in email notifications.query
: an object to query data. See below:skip_truncate
: won't truncate the thread keys to 27 characters, which is the default setting.
For example:
// called when user has succesfully logged in
api.on('login', function() {
// re-initialize with the new "authenticated data"
api.call('init', { path: '/goma', expand_all: true }, function(data) {
})
})
You can attach any metadata to your posts and you can use the query
parameter to filter and sort the returned data. This is only available for all trials and all plans of at least the M level and above.
version
: The version of the query syntax. Currently1
.path
: The path where to query from such as '/playground/tests',filter
: Only return posts with this metadata. For example{ assigned: 'courtney' }
,sort
: The field used for sorting. For example['priority']
Here's an imaginary example to find artists with most stars:
api.call('init', {
query: {
version: 1,
path: '/playground',
filter: {
'meta.public.str_tags': ['electric', 'techno'],
'meta.public.str_city': ['berlin', 'rome']
},
sort: ['meta.public.stars']
}}, function(data) {
})
Check whether given field is available (and not yet reserved). Here's how you check for a single field:
this.call('isAvailable', { email: '[email protected]' })
Available fields are username
, email
and name
.
Like a given post and increase it's like_count
and add an entry to the users that liked the post to be returned with whoLikes
call.
path
: path to the liked post.
A "like" event is fired with path as the argument.
You can also create a new thread just by liking a certain path. On this case you need to provide additional parameters as follows:
path
: path of the thread such as "/goma/gallery#my-thread"pageLocation
: the location of the page to be used on the email notification linksthreadTitle
: the title of the threadpageTitle
: the title of the hosting page
Logs out the current user and basic operations.
path
: the root path of the forum where to log out such as "/goma/" requiredexpand_all
: whether all threads should be expanded on the return value.
The new initial data where posts are in anonymous state.
Gets the rest of the body if the post is large.
path
: path to the post.
Get more replies for a given post
path
: the path of the post such as "/gom/gallery#who-likes-this-art".start
: the start index of the results.end
: the end index of the results.
Returns an array of post objects.
Posts a new reply to a thread.
path
: the path of the parent thread. requiredbody
: the message body as JavaScript array of paragraphs. requiredkey
: the id of the post. Shown on the address bar.watch
: iftrue
then the current users starts receiving email notifications about new replies.pageLocation
: (required ifwatch
is set totrue
) the location of the page to be used on the email notification linkspageTitle
: (required ifwatch
is set totrue
) the title of the hosting pagemootTitle
: (required ifwatch
is set totrue
) same aspageTitle
meta
: metadata for the post to be queried when filtering posts. For example{ public: { foo: 899 }}
Returns the possibly auto- generated key.
A "reply" event is fired with path and the reply object as arguments.
Sets forum categories, ie. the discussion areas.
path
: the forum path, such as "/goma"categories
: array of categories. For example
[
{ title: 'Gallery', path: '/goma/gallery'},
{ title: 'Exhibitions', path: '/goma/exhibitions'},
...
]
A "categories" event is fired with the new categories as argument.
Set's metadata for a thread or post
path
:meta
: metadata for the post to be queried when filtering posts. Example values:
{
str_tags: ["support","questions","billing"],
str_assigned: "johndoe",
str_status: "open"
}
A "meta" event is fired with the metadata as argument.
Disable all notifications for the user from a forum.
forumname
: name of the forum
Disable all notifications for the user from a forum.
forumname
: name of the forum
Flag a post as spammed. The impact of this action depends on the user. Admin has the most power.
path
: the path of the post to be flagged as spam.
Collapses a thread so only the basic information of the thread is returned.
paths
: an array of thread paths to collapse.
Creates a new thread
title
: message title. requiredpath
: the target channel. requiredbody
: the message body as array. each element in array represents a paragraphkey
: a human readable id for the post. If you leave this out the key is auto-generated on the server and returned on the call.watch
: iftrue
then the current users starts receiving email notifications about new replies.
Returns the possibly auto- generated key.
NOTE most calls on Muut require a path
parameter. Thread path is constructed as follows:
[channel_path]#[returned_key]
For example "/playground/general#my-test-thread".
A "thread" event is fired with thread data as first argument and seed post data as the second argument.
Expands a thread and loads the seed posts and the recent replies. The expanded state of each thread is remembered for authenticated users.
path
: a path to the thread to be expanded.
Move a thread from one channel to another.
src
: the original channeldst
: the target channel
Stops the thread from raising to the top (recent posts) when new replies are posted.
path
: the path of the retired thread.
Returns 10 most recent threads.
path
: the path of the channel such as "/goma/galleries" whose threads are returned.expand_all
: whether all threads should be expanded by default.start
: the start offset of the results. Default0
– start from the beginning.skip_truncate
: won't truncate the thread keys to 27 characters, which is the default setting.query
: an object to query data. See query parameter.
Returns a list of thread objects.
Makes the thread behave normally so that it becomes the first on listings when new replies are posted.
path
: the path of the unretired thread.
Stop receiving notifications from this trhread.
path
: the path of the unwatched thread.
Start receiving notifications from this trhread.
path
: the path of the watched thread.
You can create a new thread just by watching a certain path. On this case you need to provide additional parameters as follows:
path
: path of the thread such as "/goma/gallery#my-thread"pageLocation
: the location of the page to be used on the email notification linksthreadTitle
: the title of the threadpageTitle
: the title of the hosting page
Notifies other people that the current user is typing a message.
path
: the path of the channel ("/goma/gallery") or thread ("/goma/gallery#my-thread")size
: the amount of characters typed that is passed the notification event
A "type" event with the path and size information is fired.
Unlike a post (take away the like flag).
path
: path to the unliked post.
An "unlike" event is fired with path as argument.
Unmark a post from being spammed. The impact of this action depends on the user. Admin has the most power.
path
: the path of the post to be unspammed.
Returns a list of users that matches a given username.
username
the username to look for
Sets the user "invisible" so that the user is no longer listed on online user's list on the init return value.
A "leave" event is fired.
Make the user visible on the online user list so that other people think the user is not online.
An "enter" event is fired.
Updates the current user
displayname
: The display name field name.email
: The new email address. A confirmation link is send.img
: The uploaded avatar file name.files
: the uploaded image as taken withFileReader
on the client application. Supplied as single entry on an array[ file ]
.
Retreives the list of users that have liked the given post.
path
: path to the post.
Returns an array of user objects.