Returns information about a specific event.
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 brif 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 in charge 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 equivalent 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 |
email | 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 |
Sample REST Response
http://api.newspark.ca/services/rest/events/getEvent?eventId=[EVENT_ID]&APIKEY=[APIKEY]
<?xml version="1.0" encoding="UTF-8"?>
<result>
<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>USER_ID</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_ID</vhost>
<other>
<key>value</key>
</other>
<custom1/>
<treeleft>65</treeleft>
<treeright>66</treeright>
<email>CREATED_BY_USER_EMAIL</email>
<startDate/>
<endDate/>
</result>
Sample JSON Response
{
"status": true,
"result": {
"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",
"other": {
"key": "value"
},
"custom1": "",
"treeleft": "65",
"treeright": "66",
"email": "CREATED_BY_USER_EMAIL",
"startDate": null,
"endDate": null
}
}
PHP-RPC
$path = 'https://api.newspark.ca/services/php';
// Listing the arguments
$arguments = array(
'APIKEY' => 'YOURAPIKEY',
'method' => 'events.getEvent',
'eventId' => $eventId
);
// http_build_query basically turns an array into a url-encoded list of variables
$url = $path .'?' . http_build_query($arguments,null,'&');
// get the contents from the specified url
$data = file_get_contents($url);
// transform it back into php data structures
$data = unserialize($data);
// the actual data is stored in $data['result']
print_r($data['result']);
back to topPEAR XMLRPC client
// Include the client
require_once 'XML/RPC.php';
// Create the XMLRPC Client
$client = new XML_RPC_Client('/services/xmlrpc?APIKEY={YOURAPIKEY}', 'api.newspark.ca');
// PEAR's XML-RPC client requires all arguments to wrapped in a special value class
// XML_RPC_encode converts this automatically
$arguments = array(
XML_RPC_encode($eventId)
);
// Creating an XML-RPC message
$message = new XML_RPC_Message('events.getEvent',$arguments);
// Sending the message to the server
$response = $client->send($message);
// We also need to decode the response back to normal PHP types
$response = XML_RPC_decode($response);
print_r($response);
back to topSabreTooth XMLRPC client
// Include the client
require_once 'Sabre/XMLRPC/Client.php';
// Create the XMLRPC Client
$xmlrpc = new Sabre_XMLRPC_Client('https://api.newspark.ca/services/xmlrpc?APIKEY={YOURAPIKEY}');
$arguments = array(
$eventId
);
$data = $xmlrpc->invoke('events.getEvent',$arguments);
print_r($data);
back to topZend XMLRPC client
// Include the client
require_once 'Zend/XmlRpc/Client.php';
// Create the XMLRPC Client
$client = new Zend_XmlRpc_Client('https://api.newspark.ca/services/xmlrpc?APIKEY={YOURAPIKEY}');
$arguments = array(
$eventId
);
$data = $client->call('events.getEvent',$arguments);
print_r($data);
back to topActionscript 2
/*
* In ActionScript 2 remote service calls are done using the RemotingConnector Component.
* An instance of the component must exist on the stage and have an instance name.
*
* Results and Faults are handled by addEventListener's and the call parameters are placed inside of an associative array
*
* You must also specify the service class and method names under the appropriate property fields of the component
*/
var gatewayURL:String = "/services/amf2";
//Set up service call
myRemConn_rc.gatewayUrl = gatewayURL;
myRemConn_rc.serviceName = "events";
myRemConn_rc.methodName = "getEvent";
myRemConn_rc.params = {eventId:eventId};
myRemConn_rc.addEventListener("result", widgetResult);
myRemConn_rc.addEventListener("status", widgetFault);
//Make the call
myRemConn_rc.trigger();
/*
* Handles service result.
*/
function widgetResult(ev:Object){
//Do stuff
//Data is returned inside of ev.target.results
//(i.e. ev.traget.results.description or ev.traget.results.settings.color)
}
/*
* Handles service fault.
*/
function widgetFault(ev:Object){
//Display Error
trace("Categories Error - " + ev.code + " - " + ev.data.faultstring);
}
back to topActionscript 3
/*
* In ActionScript 3 remote service calls are done using the NetConnection Object.
* A Responder Object controls what functions handle successful or failed calls
* and any parameters for the call are placed in an array and passed as a parameter
* in the NetConnection.call() method.
*/
var gatewayURL:String = "/services/amf2";
var parameters:Array = new Array(eventId);
var connection:NetConnection = new NetConnection();
connection.connect(gatewayURL);
connection.call("events.getEvent", new Responder(widgetResult, widgetFault), parameters);
/*
* Handles service result.
*/
function widgetResult(ev:Object):void{
//Do stuff
//Data is returned inside of ev
//(i.e. ev.description or ev.settings.color)
}
/*
* Handles service fault.
*/
function widgetFault(ev:Object):void{
//Display Error
error.showError(parentClip, ev.code + " - " + ev.description, "Please refresh your browser to try again.");
error.x = (parentClip.width - error.width) / 2;
error.y = (parentClip.height - error.height) / 2;
}
back to topREST service example
<%@ Page Language="vb" %>
<%
' REST gateway
dim gateway as string = "http://api.newspark.ca/services/rest/"
' Service + method we're calling.
dim method as string = "events/getEvent"
dim apiKey as string = "YOURAPIKEY"
dim url as string = gateway & method & "?APIKEY=" & apiKey & "&eventId=" & eventId
' HTTP Client
dim wcHTTPScrape as new System.net.WebClient()
' Opening a stream
dim objInput as System.IO.Stream = wcHTTPScrape.OpenRead(url)
dim objReader as new System.IO.StreamReader ( objInput )
' Reading the entire HTTP response and output it
Response.Write ( objReader.ReadToEnd () )
objReader.Close ()
objInput.Close ()
%>
back to topjQuery JSON
/*
* jQuery post example
*/
function getEvent ( eventId ) {
var params = {
"method" : 'events.getEvent',
"eventId" : eventId}
$.post('/services/json',params
,function(response){
console.log(response);
});
back to topLocal API
// Get the Service Mapper
$mapper = Sabre_ServiceMap_Mapper::getMapper();
// Calling the method
$data = $mapper->events->getEvent( $eventId );
print_r($data);
back to top