ParksnPeaks API

We have made available a number of APIs which make ParksnPeaks data available to use for integration into applications.

This is a RESTful service. External applications will access then manipulate textual representations (XML (RSS), HTML or JSON format) of ParksnPeaks data using a predefined set of stateless operations.By making use of a stateless protocol and standard operations, this interface will provide fast and reliable access to data and be managed and updated without affecting ParksnPeaks as a whole

API calls are supported by Key Words:

 

Each keyword is discussed below;


SPOTS

Spots are current activity. This is the data displayed on ParksnPeaks;

<Screen Shot>

Default requests returns Spots either all or by class. The class keyword is passed;

Keywords will return current spots filtered by activity and in JSON or RSS format.

Keyword 

This command supports VK3ZPF 'VK port-a-log' application. Peter VK3ZPF's VK port-a-log is an andriod based application that exploits ParksnPeaks to support portable logging and spotting.  

This will return filtered SPOTS in RSS format;

SPOTS Return Format

APIs will return JSON data by default. RSS is supported for some calls. 

To receive SPOT data in RSS format add RSS keyword;


SPOT  

Keyword 

This provides the ability POST spots. A JSON string of variables is passed; 

Required Input:

All variables are case sensative and rerquired;

Name Desc Status Notes
actClass Class for Spot R SOTA,WWFF, SHIRES,SANPCPA,KRMNPA
actSite Site key R VKFF-0024,VK1/AC-001,AS3
mode mode R SSB,CW
freq Frequency R 7.144,7.032,14.062
actCallsign activator Callsign R Callsign of the activator
userID ID of user making spot R
APIKey Key fro user authentication R API Key is required for this feature. Users API key is available on the sites User Option page. 
comments Comments R 120 characters max
Example of setting a SPOT;

This is a POST request

Host: parksnpeaks.org

User-Agent: curl/7.43.0

Accept: */*

Content-Type: application/json

Content-Length: 169

print_r - stdClass Object

(

    [actClass] => WWFF

    [actCallsign] => vk3arh

    [actSite] => VKFF-0619

    [mode] => SSB

    [freq] => 7.095

    [comments] => Test%20spot%20from%20vk3arh

    [userID] => testing

    [APIKey] => ABCDE12345

)

in setupSpot.

Passed -> {"actClass":"WWFF","actCallsign":"vk3arh","actSite":"VKFF-0619","mode":"SSB","freq":"7.095","comments":"Test%20spot%20from%20vk3arh","userID":"test","APIKey":"ABCD1234"}

about to display passed variables.

actClass:WWFF

actCallsign:vk3arh

actSite:VKFF-0619

mode:SSB

freq:7.095

comments:Test%20spot%20from%20vk3arh

userID:testing

APIKey:ABCDE12345

<p>In processParkSpot. Ready to add - INSERT INTO activations (actClass,actTime,actCallsign,actLocation,actFreq,actMode,actComments,actSpoter,WWFFid) VALUES ('WWFF','2017-03-18 04:58:59','VK3ARH','Alpine National Park','7.095','SSB','Test spot from vk3arh','TE1ST','VKFF-0619')

Success!


ALERTS  

Alerts are upcoming activity. 

Keyword 

This will return current alerts for upcoming activations in JSON format. 

Examples of alerts requests;


ALERT

Keyword 

This will provide the ability POST an alert. 

Same call format as for sending a spot however additional information is required to sort out the proposed time of activation.

"alDate":"2016-01-07","optDate":"0","optTime":"0"

Required

Variables are case sensative and if optDate is set then altTime is ignored otherwise required;

Name Desc Status Notes
actClass Class for Spot R

SOTA

WWFF

SHIRES

Shires

SANPCPA

KRMNPA

actSite Site key R VKFF-0024,VK1/AC-001,AS3
mode mode R SSB,CW
freq Frequency R 7.144,7.032,14.062
actCallsign activator Callsign R Callsign of the activator
userID ID of user making spot R
APIKey Key fro user authentication R API Key is required for this feature. Users API key is available on the sites User Option page. 
comments Comments R 120 characters max

optDay

day timing code R

Supports broad time alerts;

  1. All Day
  2.  Morning
  3. Afternoon
  4. Evening
  5. Overnight
alDate Date of Alert O Date of activation in YYYY-MM-DD -> 2016-01-07
alTime Time of Alert O UTC time of activation in HH:MM -> 00:00

Examples of setting an Alert;

Returns - This is a POST request

Host: parksnpeaks.org

User-Agent: curl/7.43.0

Accept: */*

Content-Type: application/json

Content-Length: 220

print_r - stdClass Object

(

    [actClass] => WWFF

    [actCallsign] => vk3arh

    [actSite] => VKFF-0619

    [mode] => SSB

    [freq] => 7.095

    [comments] => Test%20alert%20from%20vk3arh

    [userID] => testing

    [APIKey] => ABCDE12345

    [alDate] => 2017-06-17

    [optDate] => 0

    [optTime] => 0

)

in setupAlert.

Passed -> {"actClass":"WWFF","actCallsign":"vk3arh","actSite":"VKFF-0619","mode":"SSB","freq":"7.095","comments":"Test%20alert%20from%20vk3arh","userID":"test","APIKey":"ABCD1234","alDate":"2017-06-17","optDate":"0","optTime":"0"}about to display passed variables.

actClass:WWFF

actCallsign:vk3arh

actSite:VKFF-0619

mode:SSB

freq:7.095

comments:Test%20alert%20from%20vk3arh

userID:testing

APIKey:ABCDE12345

alDate:2017-06-17

optDate:0

optTime:0

<p>In processAlert. - INSERT INTO Alerts (alClass,alDay,alTime,alCallsign,alLocation,alFreq,alMode,alComments,alAlerter,WWFFID) VALUES ('WWFF','0','2017-6-17 00:00:00','VK3ARH','Alpine National Park','7.095','SSB','Test alert from vk3arh','TE1ST','VKFF-0619')

Success!


DELETE

Allows the user to delete an entry they own

Requires API Key to verify

Example


Locations

Location keywords return site information in JSON by class;

Additional information is required so isolate what site or sites you are looking for. Examples of location requests;

The SITES command will return JSON on all sites (Currently VK & ZL) sutiable for filling lookup boxs' ;

Award ID Name State
KRMNPA 3NP-008 Churchill VK3
SANPCPA 5CP-001 Aberdour VK5
WWFF VKFF-0994 Aberdour  VK5
SOTA VK1/AC-001 Bimberi Peak VK1
SHIRES AC2 Albury City Council VK2

SITES supports sub commands to allow for update to site data.

CHECK returns the dates of last update;

whilst the commands WWFF,SOTA,KRMNPA,SANPCPA or SHIRES returns the data for only that Class;


Location Data

This group of commands will provide information as to sites for a given location.

Given a position (latitude & longitude) exact information (Local Government Area or Gridsquare) or lists of sites surrounding the position can be obtained.

Keywords 

Location keywords require Latitude and Longitude and will return site information as a string,

SHIRESID returns the ID for the given cordinates

GRIDSQUARE returns 6 digit gridsquare for the given cordinates.

SUMMITID returns the SOTA Summit within 125 meters of the given cordinates.

PARKID returns the WWFF Park within 5km meters of the given cordinates.

The next group of location keywords again require Latitude and Longitude and optionally Distance in km, will return site information as JSON.

PARKS returns JSON with the IDs and name of Parks within distance or by default 80Km of the given coordinates.

PEAKS returns JSON with the IDs and name of Peaks within distance or by default 80Km of the given coordinates.

CLOSE returns JSON containing WWFF Parks and SOTA Peaks within 80Km. Maximum of 5 entries for each class are returned for a maximum of 10 entries despite distance. This command is intended to allow quick list of opportunities in the surrounding area.

For detailed list of sites use direct class requests PARKS or PEAKS.


User

USERS with no arguments will return the user table in JSON

USERS passed a callsign will return name for a given callsign


Debug option and Examples

VERSION will return the current version

'DEBUG'  appended to the request will return debug info and log the request for review later.

Examples

Using GET to test SITES data;

Using CURL to verify PUT

Using HTTP GET to test receiving current SPOT activity in RSS

Using CURL to test ALERT via POST

Using CURL to test SPOT via POST

Using CURL to test SPOT with PUT

Location Testing

These cordinates should return 'Currently not within a Park.' else there are entries in the database with GISID =''.


Other Links;


API v1.0.3.1 © 2017 Allen Harvie VK3ARH . Parts © Marc Hillman VK3OHM

For assistance contact ParksnPeaks support