You are here

joinSite

public Site joinSite(Site site) - Adds the surrent user as a member of the specified site.

If the site is moderated, the returned Site object will have its isPendingMember flag set to true and isMember flag set to false.

If the site is public the isMember flag will be set to true and the isPendingMember flag will be set to false.

If the current user is already a member of the site or there is a pending join request for the user an exception is thrown with error code 403, if the request fails for any other reason an exception is thrown with error code 400.

Parameters

Site site
A site object representing the site to be joined.
String message
A user-specified message explaining why the user wishes to join the site.

Returns

A Site object.

Exception

Throws an SkyVaultServiceException if the operation cannot be carried out with an error code of 403 or 400. If the current user is already a member of the site or there is a pending join request for the user an exception is thrown with error code 403, if the request fails for any other reason an exception is thrown with error code 400.

Example


				case JOIN:
					site = siteService.joinSite(site);
					message = "You joined site "+site.getShortName();
					break;
        
      
Note: This method was added in version 1.1.