The Podium REST API is used to securely gather information for a single app. All requests are made to the secure API URL, and most return a JSON response. All of this information is yours, for you to upload to your own app. The Podium platform acts as a CMS back end for your app. Each API call can also have details included to identify details such as what page the user is on, the OS, or type of device they are using. More details here.
See below for more details.
required
close will return the events geographically closest to the specified location, regardless of the start date. lat and long parameters are required with this option.
soon will return upcoming events in chronological order, regardless of the location.
all will return all events in chronological order by the start date.
single will return a single event by id, specified by the 'id' parameter.
categories will return a list of your event categories.
Example values: close, soon, all, single, categories
optional
Example values: 50
optional
Example values: comedy, music, theatre
optional
Example values: 37.421641
optional
Example values: -122.085502
optional
Example values: 1024568
optional
required
close will return the events geographically closest to the specified coordinates, regardless of the start date. lat and long parameters are required with this option.
all will return all locations in alphabetical order.
single will return a single event by id, specified by the 'id' parameter.
categories will return a list of your event categories in alphabetical orders.
Example values: close, all, single, categories
optional
Example values: 20
optional
Example values: dining, entertainment, shows
optional
Example values: 37.421641
optional
Example values: -122.085502
optional
Example values: 1024568
optional
optional
all will return all locations in alphabetical order.
categories will return a list of your event categories in alphabetical orders.
Example values: all, categories
optional
Example values: 40
optional
Example values: important, news, updates
optional
required
Example values: I3hgXvRg4cxk8r1Z85U5
optional
required
all will return all info blocks in alphabetical order by title.
categories will return a list of your info block categories in alphabetical orders.
single will return a single info block, specified by the 'xid' parameter.
Example values: all, categories, single
optional
Example values: 40
optional
Example values: important, news, updates
optional
Example values: I3hgXv4g4cxk8d1Z85U5
optional
required
Example values: Sergey
required
Example values: [email protected]
optional
Example values: Comments from our mobile app
optional
Example values: text, html
optional
Example values: true, false
optional
Example values: I3hgXvRg4cxk8r1Z85U5l
optional
Example values: s3hgevRg4cxkcsr1Z85U5
optional
required
protected will return a code for the page specified by the page parameter. If no page is specified, this will return an array of all protected pages and codes.
Example values: protected
optional
Example values: admin
optional
Podium stores your data as objects containing JSON compatible key-value pairs. You can think of Podium data storage as your app's cloud database where each object is a row in that database.
Using Podium Data Storage you can perform GET and QUERY operations.
required
The following documentation will discuss the various types of requests.
Example values: get, query
optional
required
Example values:tXAvBuAbx9, cmAAfbuAPc
required
Example values:dkEsXkDan, eWdXiMxAqk
optional
Example values: [ "itemNumber", "itemPrice", "comments" ]
required
Example values:tXAvBuAbx9, cmAAfbuAPc
optional
Example values: [ "itemNumber", "itemPrice", "comments" ]
optional
Example values: { "score" : 10, "date" : "August 19, 2004" }
optional
Example values: { "score" : 10, "date" : "August 19, 2004" }
optional
Example values: { "score" : 10, "date" : "August 19, 2004" }
optional
Example values: { "score" : 10, "date" : "August 19, 2004" }
optional
Example values: 10, 20
optional
Example values: { "score" : "desc" }
To get your nonce hash, you must create a hash-based message authentication code (HMAC) by SHA256 hashing your URL up to this point using your private key. In this example,
Public Key: KcIRoGC3WHdR29JhfN1cg
Private Key: 2ZWTeKi47fZwVPp6ds5nxUtvsvS3Hm2FLkadbcA8U2
The resulting hash is fd1552a4ce51aefe819c7196760b672f4a8c3f76c454ece62b9985c8bec40c1e
For PHP:
<? // set variables $public_key = 'KcIRoGC3WHdR29JhfN1cg'; $private_key = '2ZWTeKi47fZwVPp6ds5nxUtvsvS3Hm2FLkadbcA8U2'; $time = time(); // set data var to the URL you have built so far $data = 'https://podium.io/api/v1/events/?request=close &lat=37.421641&long=-122.085502&public_key='.$public_key.' &date='.$time; // generate hash $hash = hash_hmac('sha256', $data, $private_key); ?>
For JavaScript (Appcelerator):
Note: You must include a third party script to generate the hmac hash. The following code uses crypto-js, hosted on google code, available here.
// include cryptography script Ti.include("../../includes/CryptoJS_v3.1.2/rollups/hmac-sha256.js"); // set variables var url = 'https://podium.io/api/v1/events/'; var public_key = 'KcIRoGC3WHdR29JhfN1cg'; var private_key = '2ZWTeKi47fZwVPp6ds5nxUtvsvS3Hm2FLkadbcA8U2'; var currentTime = new Date(); var time = Math.round((currentTime.getTime())/1000); var data = url + '?request=close ⪫=37.421641&long;=-122.085502 &public;_key=' + public_key + '&date;=' + time; var hash = CryptoJS.HmacSHA256(data, private_key);
For Lua (Corona):
-- set variables local public_key = "KcIRoGC3WHdR29JhfN1cg" local private_key = "2ZWTeKi47fZwVPp6ds5nxUtvsvS3Hm2FLkadbcA8U2" local t = os.date( '*t' ) local time = os.time( t ) -- set data var to the URL you have built so far local data = "https://podium.io/api/v1/events/?request=close &lat=37.421641&long=-122.085502&public_key=" .. public_key .. " &date=" .. time -- generate hash local crypto = require "crypto" local hash = crypto.hmac( crypto.sha256, data, private_key )
{ "status":{ "message":"OK","code":100 }, "events":[ { "event_title":"Comedy Show", "event_start_date":"Mar 7 2013 5:30 pm", "event_end_date":"Mar 7 2013 6:30 pm", "event_category_1":"Comedy", "event_category_2":"Theatre", "event_category_3":null, "event_category_4":null, "event_category_5":null, "event_category_6":null, "page":"EdC4WL4cLpI34DHx286B", "event_description":"Best comedy show ever!", "location_name":"Stage 16", "location_address":null, "location_address2":null, "location_city":null, "location_state":null, "location_zip":null, "location_country":null, "location_lat":"40.7624460", "location_lng":"-111.8743240", "location_description":"North Stage", "location_distance":{ "ft":3524860, "mi":667.6 } }, { "event_title":"Magic Show", "event_start_date":"Mar 8 2013 4:30 am", "event_end_date":"Mar 8 2013 6:30 am", "event_category_1":"Shows", "event_category_2":"On Stage", "event_category_3":"Theatre", "event_category_4":null, "event_category_5":null, "event_category_6":null, "page":"", "event_description":"Best magic show ever!", "location_name":"Stage 4", "location_address":null, "location_address2":null, "location_city":null, "location_state":null, "location_zip":null, "location_country":null, "location_lat":"39.6784870", "location_lng":"-104.9221420", "location_description":"Magical Stage", "location_distance":{ "ft":5679485, "mi":1075.7 } } ] }
{ "errors":{ "message":"Forbidden", "code":403, "details":"Timestamp Out of Range" } }