WalkOn API calls

Data Queries

Top Users

Current top list can be requested using topusers.php. Following parameters can be set: monthly[returns current month results]&cat=[walks|volunteered|donations]&limit=[numbers of rows]. If limit or cat is not set, default values will be assigned. It returns UserID, First Name, Last Nam, value of specified request and LastUpdate as JSON (or XML when parameter xml is specified).

  • Sample 1 (walks): http://veikoh.freehostia.com/WalkOnApi/toplist.php?limit=5&cat=walks
  • Sample 2 (donations): http://veikoh.freehostia.com/WalkOnApi/toplist.php?limit=5&cat=donations&monthly
  • Sample 3 (XML): http://veikoh.freehosti.com/WalkOnApi/toplist.php?xml&limit=5
  • Events

    Events can be requested using events.php. It accepts parameters cat=[event category]&lat=[location latitude coordinate]&lon[location longitude coordinate]&featured[returns only main events]&lang=[for multiple language purposes]&userid=[returns only events created by that user]&volunteer[returns only events that have voluteering places]&limit=[number of rows] or eventid[to return only one event data]. When lon and lat has been specified, the result will be ordered based on location “nearest first” otherwise by time “happening first”. When type is not specified, all events in the database that has date set to future will be listed. It returns database columns in JSON (or XML when parameter xml is specified) format.

  • Sample 1: http://veikoh.freehostia.com/WalkOnApi/events.php?limit=5
  • Sample 2: (location): http://veikoh.freehostia.com/WalkOnApi/events.php?limit=5&lat=2.1&lon=41
  • Sample 3: (xml): http://veikoh.freehostia.com/WalkOnApi/events.php?xml&limit=5
  • Charities

    Charities and donation possibilities can be requested using causes.php module. If parameter promoters is set, it returns users that had decided to promote a charity, otherwise it returns charities from our database. when charityid is set it returns only one charity, otherwise the limit parameter can be set to limit the number of records in return. parameter userid returns charities created by that user. When parameter xml isnt set, the output will be returned in JSON format otherwise in XML format. Using parameter lang, the return can be limited by specific language. The result set is ordered randomly.

  • Sample 1:http://veikoh.freehostia.com/WalkOnApi/causes.php?limit=4
  • Sample 2:http://veikoh.freehostia.com/WalkOnApi/causes.php?promoters&limit=4
  • Sample 3:http://veikoh.freehostia.com/WalkOnApi/causes.php?xml
  • Groups

    groups.php returns User Groups to join. If parameter userid or groupid is set, it returns one group, otherwise all groups. If parameter mysgroups is specifed it returns groups created by specific user. Paremeter lang can be specified to support multiple languages. If parameter xml isnt specified, the output will in JSON format.

  • Sample 1: http://veikoh.freehostia.com/WalkOnApi/groups.php
  • Sample 2: http://veikoh.freehostia.com/WalkOnApi/groups.php?mygroups&userid=7
  • Sample 3: http://veikoh.freehostia.com/WalkOnApi/groups.php&xml
  • Users

    The users module returns users joined or volunteerd to event, joined groups or promote charities. If parameter eventid is set, it returns users joined to that event, additional parameter [volunteers|joined] can be used. If parameter groupid is set, it returns users joined to particular group. Using parameter charityid it returns users joined to promote that charity. Using parameter xml, the output will be in XML format, otherwise it returns JSON.

  • Sample 1: http://veikoh.freehostia.com/WalkOnApi/users.php?eventid=71&joined
  • Sample 2: http://veikoh.freehostia.com/WalkOnApi/users.php?groupid=2
  • Sample 3: http://veikoh.freehostia.com?WalkOnApi/users.php?eventid=71&xml
  • User Data

    The user.php can be used to return user detailed data by userid. If xml parameter is set, the data is returned in XML format, otherwise JSON will be used.

  • Sample 1: http://veikoh.freehostia.com/WalkOnApi/user.php?userid=7
  • Sample 2: http://veikoh.freehostia.com/WalkOnApi/user.php?userid=7&xml
  • Data Input

    An appid and app secret is required for data input

    To register your app

    or reset the app secret

    Login

    The login.php module verifies the user and returns userid, authorisation key and user rights in JSON format. The valid appid and appsecret must be passed on to use this module. logout.php can be called to clean the user key.



    User Activities

    All user related activites are using the uactiv.php module depending on the parmeters set. New user can be registered also using this module when firstname, lastname, email and pass is set and user email isnt found in the database. When also pass2 is set, it verifies that passwords will match during the process. For other activities a valid userid and key must be sent aquired during login process. When pass (with or without pass2) is set, the module changes user password. When lang is set, the module changes user preferred language. When groupid is set, the module changes user group. When eventid is set and such kind of event is valid for this activity, then depending on parameter (volunteer or join), user will be registered to that event. When mission is set, user mission description will be updated. Parameters hours, donation or miles will create such kind of activity records. Those will accept only values over 0 and under 1000. Parameter delacct will delete user account. This module also assignes user badges depending on the algorithm. NOTE: To call this module, a valid appid and appsecret must be passed to it.

    The innput can be also XML file or string using file or xml POST variables accordingly. When parameters “userid” or “email” are set, those users will be updated.

    Sample XML input:
    
    <users>
    <user>
    <firstname>monica</firstname>
    <lastname>lewinsky</lastname>
    <email>mlewinsky@yahoo.com</email>
    <miles>23</miles>
    </user>
    <user>
    <email>veiko_h@yahoo.com</email>
    <donation>200</donation>
    </user>
    <user>
    <hours>12</hours>
    <id>21</id>
    </user>
    </users>
    
    Import user activities

    or write XML here

    Events

    New event can be added or existing event modified using event.php. The needed columns will be sent as POST parameters (or XML elements). The return value could be some error or success code.

    Following parameters can be set:

    eventid (when set, the record will be updated);
    eventname (required when eventid isn’t set);
    eventdescription;
    eventlocation;
    locationlatitude;
    locationlongitude;
    eventimage (url for the image);
    image1 (additiona image);
    image2 (additional image);
    image3 (additional image);
    eventpage (url for the page);
    eventcategory (could be [24-Hour|Multi-Day|5K/10K|MARATHON|HALF-MARATHON], possibly multiple categories can be set over the comma);
    eventstart (the date in format YYYY-MM-DD or DD-MM-YYYY. If empty or date has already passed, those records will not show in queries);
    eventend (the date in format YYYY-MM-DD or DD-MM-YYYY. If empty, the eventstart date will be assigned);
    volunteers (the number of volunteers needed allowing walkon.org.uk members to sign volunteering);
    hours (the number of hours volunteers will donate to event). 
    volunteers and hours must be both set to allow volunteering. 

    XML can be sent as file (using file parameter) or text (using xml parameter). For example following xml adds two events and updates the date of one event:

    <events>
    <event>
    <eventname>Virgin Money London Marathon 2014</eventname>
    <eventlocation>Greenwich park, London, UK</eventlocation>
    <eventstart>13-03-2014</eventstart>
    <eventimage>http://veikoh.freehostia.com/WalkOn/img/london.jpg</eventimage>
    <eventcategory>MARATHON</eventcategory>
    </event>
    <event>
    <eventname>BM10k</eventname>
    <eventcategory>5K/10K</eventcategory>
    <eventstart>06-04-2014</eventstart>
    <eventlocation>Brighton, UK</eventlocation>
    <eventimage>http://veikoh.freehostia.com/WalkOn/img/brighton.jpg</eventimage>
    <eventdescription>The BM10k is the exciting new addition to the Brighton Marathon Weekend, which will see 2,000 people running 10,000m along the first part of the Brighton Marathon route on Sunday 6th April 2014.
     
    The BM10k will start at 8.30am ahead of the Brighton Marathon start at 9am, so Preston Park will be buzzing with participants for both events and thousands of spectators.</eventdescription>
    <eventpage>https://endurancecui.active.com/event-reg/select-race?e=5852052</eventpage>
    </event>
    <update>
    <eventid>17</eventid>
    <eventstart>03-08-2014</eventstart>
    </update>
    </events>
    
    choose XML to upload

    or write XML here

    Event Input Form















    additional images:



    Charities

    New charities can be added or existing records modified using charity.php. It accepts following parameters:

    charityname (required when inserting new record); 
    id (required when updating a record); 
    charitydescription; 
    regnr; 
    email; 
    logo (URL for the charity logo); 
    website (URL for the charity website); 
    location; 
    latitude; 
    longitude; 
    

    The appid and appsecret must be sent; also valid userid and key matching a user to have such kind of rights.

    choose XML to upload

    or write XML here










    Groups

    New groups can be created and existing modified using group.php module. Following parameters can be set:

    groupid (required when modifying group);
    groupname (required when creating a new group);
    groupimage;
    

    The appid and appsecret must be sent; also valid userid and key matching a user to have such kind of rights.