API Reference

Groups.addMember

Adds a member to a group.

This can be used by the public to add themselves to groups within the vhosts their user is in. This requires the user to be logged in. In this case both "uid" and "memberType" should be left as their defaults.

This may also be used by privileged users (those with the groups.addMember permission) to add other users within the group's vhost to a group with the specified member type.


Syntax

bool groups.addMember ( int groupId, int uid = NULL, int memberType = 2 )

Arguments

NameTypeRequiredDefault valueDescription
groupIdintRequirednoneThe group ID you are adding the user to.
uidintOptionalNULLThe ID of the user you are adding to a group.
memberTypeintOptional2The permissions you are giving the new member access to. The possible values are: 1 = invited, 2 = member, 9 = admin.

Response

Will return whether or not the member has been successfully added to the desired group.

NameTypeDescription
resultINTUpon success the response will be 1.

Sample Response

Sample REST Response
http://api.filemobile.com/services/rest/groups/addMember?uid=[USER_ID]&groupId=[GROUP_ID]
<?xml version="1.0" encoding="UTF-8"?>
<result>1</result>
Sample JSON Response
{
    "status": true,
    "result": 1
}

Code examples

0 comments

Be the first to comment on addMember.

Add a Comment

  • captcha