API Reference

Groups.createGroup

This method returns the new group id.


Deleting a Group

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

Syntax

int groups.createGroup ( int vhost, string name, array additionalInfo = array() )

Arguments

NameTypeRequiredDefault valueDescription
vhostintRequirednoneThe vhost ID that you want the group to be a member of.
namestringRequirednoneThe name you want the group to have.
additionalInfoarrayOptionalarray()Any and all additional information that you want stored with the group. This is an ARRAY.

additionalInfo

additionalInfo is an array that consists of the information that you want to have stored 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

fileData is an array that consists of the information that you want to have stored in your media.

NameTypeDescription
resultINTThe ID of the newly created group.

Sample Response

Sample REST Response
http://api.newspark.ca/services/rest/groups/createGroup?vhost=[VHOST]&name=[NEW_GROUP_NAME]&additionalInfo[email]=[USER_EMAIL]&additionalInfo[other][key]=value&APIKEY=[APIKEY]
<?xml version="1.0" encoding="UTF-8"?>
<result>NEW_GROUP_ID</result>
Sample JSON Response
{
    "status": true,
    "result": NEW_GROUP_ID
}

Code examples

0 comments

Be the first to comment on createGroup.

Add a Comment

  • captcha