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 )
Name | Type | Required | Default value | Description |
---|---|---|---|---|
vhost | int | Required | none | The vhost ID that the event belongs to. |
uid | int | Optional | NULL | Filter by and only return events that the given user ID is a member of. |
moderationStatus | string | Optional | 'accepted' | Filter the event list by the specified moderation status. The possible values are "accepted", "denied", "unmoderated", "moderated", "notdenied","all". |
filters | array | Optional | array() | See the list of possible filters for events.getEvents service below. |
sort | string | Optional | '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". |
startPage | int | Optional | 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). |
pageSize | int | Optional | 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. |
includeTotalCount | bool | Optional | 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. |
noLimit | bool | Optional | 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. |
childGroupCount | bool | Optional | 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.
Name | Type | Description | Default | Possible Values |
---|---|---|---|---|
creatorUserID | INT | Returns only events created by the specified user ID. If the user ID specified is not the user that is currently logged in and is not the public user then a check is made for the "events.getEvents" permission. | empty | INT |
parentEventID | INT | Returns only events whose parent is the event specified. | INT | INT |
includeChildren | BOOL | Returns all events who have parentEventID as their ancestor. May only be used in combination with the parentEventID filter. | true | false |
searchQuery | STRING | A string that must exist in at least one of the following fields. | empty | name, description, address, host, city |
searchName | STRING | A string that must exist in the name of the events returned. | empty | STRING |
searchDescription | STRING | A string that must exist in the description of the events returned. | empty | STRING |
custom1 | STRING | A string that must match the value of the custom1 field of the events returned. | empty | STRING |
mediaID | INT | A media item that must be present within the events returned. | empty | INT |
endBefore | YYYY-MM-DD HH:MM:SS | A date and time that the listed events must end before. | empty | YYYY-MM-DD HH:MM:SS |
endAfter | YYYY-MM-DD HH:MM:SS | A date and time that the listed events must end after. | empty | YYYY-MM-DD HH:MM:SS |
The response items returned in a events.getEvents service call.
Name | Type | Description | Possible Values |
---|---|---|---|
id | INT | The ID of the event. | INT |
name | STRING | The name of the event. | STRING |
description | STRING | A brief blurb about the event. History, purpose, location, ideas, awards, etc. The description is searchable. | STRING |
note | STRING | Some text about the event. The note is not searchable. | STRING |
logo | INT | The media ID that is used as the event logo. | INT |
publicUrl | STRING | The url to access the event logo. The public url will log a hit against the media item when ever loaded. This would be best used on an event details page. | STRING |
thumbUrl | STRING | The url to access the event logo. The thumb url will _NOT_ log a hit against the media item when loaded. This is best used in event galleries or plotting events on a map. | STRING |
url | STRING | The url of the event. This is used best if the event is for a company, an event with a unique url they wish to also direct traffic to. | STRING |
created | YYYY-MM-DD HH:MM:SS | The date the event was created | YYYY-MM-DD HH:mm:SS |
createdBy | INT | The user ID of the user who created the event. | INT |
memberCount | INT | The number of members in the event | INT |
mediaCount | INT | The number of media items in the event. | INT |
approvedMediaCount | INT | The number of approved media items in the event. | INT |
notDeniedMediaCount | INT | The number of not denied media items in the event. | INT |
geo_longitude | LNG | The longitude of the event. This would be specified by the creator of the event. | NUMBER (-52.44) |
geo_latitude | LAT | The latitude of the event. This would be specified by the creator of the event. | NUMBER (62.86) |
moderationStatus | STRING | The moderation status of the event which has just been created. By default if this is not passed the events moderationstatus will be unmoderated. | accepted, denied, unmoderated, moderated, notdenied, all |
parentEvent | INT | The ID of the parent event if the current event is a child. | INT |
address | STRING | The address of the event. | STRING |
city | STRING | The city that the event is located in. | INT |
country | STRING | The country that the event is located in. This will be a 2-letter country code. | STRING |
state | STRING | This will be the state/province that the event is located in. It will be a 2-letter state/province code. | STRING |
postalcode | STRING | A valid postal code to contact the event by. | STRING |
newMediaEmailTemplateID | INT | This is the ID of the email template that is sent out when a user uploads media into the event. | INT |
host | STRING | The name of the host who created the event or who is inchagre of the event. | STRING |
groupType | INT | This specifies if the group is a group or an event. 1 represents a group and 2 represents an event. | 1/2 |
vhost | INT | The vhost ID that the event belongs to. | INT |
other | ARRAY | An associated array that is used to store any additional information about the event that does not fit in any previous fields. This field is _NOT_ searchable or filterable. This is equivelent to the metadata field for media. | ARRAY |
custom1 | STRING | A searchable and filterable field for any additional information that does not fit into any previous field. | STRING |
treeleft | INT | Used internally for the sorting and ordering events. | INT |
treeright | INT | Used internally for the sorting and ordering events. | INT |
STRING | The email address to use to allow users to email content to this email address and have it uploaded and entered into the event. | STRING | |
totalCount | INT | If the includeTotalCount argument is set to true the total count of events returned will be included in the response. | INT |
startDate | YYYY-MM-DD HH:MM:SS | The start date of the event. | YYYY-MM-DD HH:MM:SS |
endDate | YYYY-MM-DD HH:MM:SS | The end date of the event. | YYYY-MM-DD HH:MM:SS |
<?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" } }