API Reference

Groups.updateGroup

Updates group information based on a group ID


Deleting a Group

NB: To delete a group, you use the function updateGroup, and set the moderationStatus to deleted.

Syntax

bool groups.updateGroup ( int groupId, array newInfo )

Arguments

NameTypeRequiredDefault valueDescription
groupIdintRequirednoneThe ID of the group you want to update.
newInfoarrayRequirednoneThe information about the group that you want to update.
Note: For the list of paramaters that can be passed in the newInfo array, please refer to the documentation for the 'additionalInfo' argument for the groups.createGroup API call.

newInfo

newInfo is an array that consists of the information that you want to have updated in your group.

NameTypeRequiredDefaultPossible ValuesDescription
emailstringno email@example.comThe email address that users can use to email media into the group.
descriptionstringno  stringA blurb of text that describes what the group is all about. The description is searchable.
logointno05000444A media ID for a piece of media that is to be used as the group logo. The default value is 0, which means that the group has no logo assigned to it.
urlstringno http://example.comThe url for the group.
createdByintno14155555The UID of the user who created the group.
notestringno stringSome text about the group. The note is not searchable.
geo_longitudefloatno0-52.44The longitude of the group. This would be specified by the creator of the group.
geo_latitudefloatno062.86The latitude of the group. This would be specified by the creator of the group.
moderationStatusstringnounmoderatedunmoderated, accepted, denied, deleted, notdenied, moderated, allThe moderation status once the group has been created in MediaFactory.
addressstringno stringThe address of the group. This is used if the group is a company, branch etc. This would be the office location.
citystringno  TorontoA city that the group is associated with.
countrystringno  CA, USThe 2-letter country code for the group location.
statestringno ONThe 2-letter state / province code for the group.
postalcodestringno M1M1M1A valid postal code to contact the group.
otherarrayno {'key': 'value'}This is any additional information about the group that does not fit into the fields above.
custom1stringno stringA searchable string for additional content that you want stored about the group.
startDatetimestampno0000-00-00 00:00:002012-02-15 00:00:00The date and time that the group begins.
endDate timestampno0000-00-00 00:00:002012-03-25 14:10:11The date and time that the group ends.
parentGroupintno09499The ID of the parent group for the group to be created. The default value is 0, which means that the group has no parent; it is the top-level.

Response

The expected response for a successful update group request.

NameTypeDescription
resultINTOn success the response will be 1.

Sample Response

Sample REST Response
http://api.newspark.ca/services/rest/groups/updateGroup?groupId=[GROUP_ID]&newInfo[description]=[UPDATED_GROUP_DESCRIPTION]&newInfo[moderationStatus]=[UPDATED_MODERATION]
<?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 updateGroup.

Add a Comment

  • captcha