Returns a list of events for a specific vhost.
Pagination may be controlled via the "startPage" and "pageSize" parameters
The optional "sort" argument is a string that can be used to specify one field to sort the returned events by.The sort parameter can also include a sort direction ("ASC" or "DESC").
All events returned will have a last resort sort applied based on the unique event ID to ensure a consistent ordering of events even when the specified sort field is not unique. Example: sort="membercount DESC" - This will return a list of events with the events with the most members first. If multiple events have the same number of members then the ones with identical member counts will be ordered by ID equivalent to sort="membercount DESC, id".
To arrange the events or events in the same order as they appear in the tree within MediaFactory you must sort by "treeleft ASC". The fields supported for sorting are: membercount, id, created ,mediacount ,approvedmediacount ,notdeniedmediacount ,name, treeleft.
The various date filters are all parsed via the equivalent of PHP's strtotime function: http://php.net/manual/en/function.strtotime.php. The preferred form is YYYY-MM-DD HH:mm:ss
array events.getEvents ( int vhost, int uid = NULL, string moderationStatus = 'accepted', array filters = array(), string sort = 'created DESC', int startPage = false, int pageSize = false, bool includeTotalCount = false, bool noLimit = false, bool childGroupCount = false )
Type | Description | |||
---|---|---|---|---|
none | The vhost ID that the event belongs to. | |||
NULL | Filter by and only return events that the given user ID is a member of. | |||
'accepted' | Filter the event list by the specified moderation status. The possible values are "accepted", "denied", "unmoderated", "moderated", "notdenied","all". | |||
array() | See the list of possible filters for events.getEvents service below. | |||
'created DESC' | Sets the sort field. Use the format fieldname ASC/DESC. Currently created, membercount, mediacount, id, approvedmediacount, notdeniedmediacount, name, startdate, enddate, and treeleft are supported. To retrieve the events in the same order they are in the event tree use "treeleft ASC". | |||
false | Sets the startpage for the event list. This is used with pagination in conjunction with pageSize. The starting page index is 0 (the first page). | |||
false | Sets the total number of items returned per page. This is used with pagination and in conjunction with startPage. The maximum number of events to include on each page by default is 100 and the maximum is 200. | |||
false | If "includeTotalCount" is "true" then the total number of matching events will be returned along with the events themselves. If it's "false" then the total count will not be returned. The default for includeTotalCount is false. | |||
false | You may disable all pagination and limits on the number of events returned by setting the "noLimit" parameter to "true". This requires the events.getEventsNoLimit permission. | |||
false | If "childGroupCount" is "true" then the total number of child events for the parengGroupId will be returned. If it's "false" then the total count will not be returned. The default for childGroupCount is false. |
The optional "filters" parameter is an array that may contain the following keys and values.
The response items returned in a events.getEvents service call.
<?xml version="1.0" encoding="UTF-8"?> <result> <item> <id>EVENT_ID</id> <name>EVENT_NAME</name> <description/> <note/> <logo>0</logo> <publicUrl/> <thumbUrl/> <url/> <created>2012-02-13 11:15:44</created> <createdBy>1</createdBy> <memberCount>0</memberCount> <mediaCount>0</mediaCount> <approvedMediaCount>0</approvedMediaCount> <notDeniedMediaCount>0</notDeniedMediaCount> <geo_longitude>0</geo_longitude> <geo_latitude>0</geo_latitude> <moderationStatus>unmoderated</moderationStatus> <parentGroup>0</parentGroup> <address/> <city/> <country/> <state/> <postalcode/> <newMediaEmailTemplateID>0</newMediaEmailTemplateID> <host/> <groupType>2</groupType> <vhost>VHOST</vhost> <other/> <custom1/> <treeleft>65</treeleft> <treeright>66</treeright> <email>EVENT_CREATORS_EMAIL</email> <startDate/> <endDate/> </item> <item> <id>EVENT_ID</id> <name>EVENT_NAME</name> <description/> <note/> <logo>0</logo> <publicUrl/> <thumbUrl/> <url/> <created>2012-01-28 19:33:59</created> <createdBy>1</createdBy> <memberCount>0</memberCount> <mediaCount>1</mediaCount> <approvedMediaCount>0</approvedMediaCount> <notDeniedMediaCount>0</notDeniedMediaCount> <geo_longitude>0</geo_longitude> <geo_latitude>0</geo_latitude> <moderationStatus>accepted</moderationStatus> <parentGroup>0</parentGroup> <address/> <city/> <country/> <state/> <postalcode/> <newMediaEmailTemplateID>0</newMediaEmailTemplateID> <host/> <groupType>2</groupType> <vhost>VHOST_ID</vhost> <other/> <custom1/> <treeleft>59</treeleft> <treeright>60</treeright> <email>EVENT_CREATORS_EMAIL</email> <startDate/> <endDate/> </item> <totalCount>2</totalCount> </result>
{ "status": true, "result": { "0": { "id": "EVENT_ID", "name": "EVENT_NAME", "description": "", "note": "", "logo": "0", "publicUrl": "", "thumbUrl": "", "url": "", "created": "2012-02-13 11:15:44", "createdBy": "1", "memberCount": "0", "mediaCount": "0", "approvedMediaCount": "0", "notDeniedMediaCount": "0", "geo_longitude": "0", "geo_latitude": "0", "moderationStatus": "unmoderated", "parentGroup": "0", "address": "", "city": "", "country": "", "state": "", "postalcode": "", "newMediaEmailTemplateID": "0", "host": "", "groupType": "2", "vhost": "VHOST_ID", "other": [], "custom1": "", "treeleft": "65", "treeright": "66", "email": "EVENT_CREATORS_EMAIL", "startDate": null, "endDate": null }, "1": { "id": "EVENT_ID", "name": "EVENT_NAME", "description": "", "note": "", "logo": "0", "publicUrl": "", "thumbUrl": "", "url": "", "created": "2012-01-28 19:33:59", "createdBy": "1", "memberCount": "0", "mediaCount": "1", "approvedMediaCount": "0", "notDeniedMediaCount": "0", "geo_longitude": "0", "geo_latitude": "0", "moderationStatus": "accepted", "parentGroup": "0", "address": "", "city": "", "country": "", "state": "", "postalcode": "", "newMediaEmailTemplateID": "0", "host": "", "groupType": "2", "vhost": "VHOST_ID", "other": [], "custom1": "", "treeleft": "59", "treeright": "60", "email": "EVENT_CREATORS_EMAIL", "startDate": null, "endDate": null }, "totalCount": "2" } }