M-API v1

The M-API is an effort to surface frequently requested data for use in Massey websites and Massey applications

V1 is a development experiment for DATA RETRIEVAL ONLY, not recommended for public consumption, is not supported, and may be discontinued without notice

Basics

Basic structure

www.massey.ac.nz/api/v1/massey.cfc?apikey={apikey}method={method}&format={format}&path={path}&args={args}

The M-API is exposed through a URL with a number of important query parameters described below. The eventual goal of the M-API is to be completely RESTful however time constraints mean this is not possible for Version 1.


&apikey=

REQUIRED

&apikey={apikey}

M-API V1 only work with a valid api key. You will need to apply for one to use this api. Applications for new apikeys is not yet publicly available.

Warning! The test api key for this page is currently 12345. It changes frequently, returns cached, non-acurate demonstration data and is not available for production use.

&apikey=12345


&method=

REQUIRED

&method={method}

M-API V1 only permits the 'get' method for data retrieval. Although there is only one option it still must be included in the URL.

&method=get


&format=

Default: 'xml'

&format={format}

The api can return the data in either xml or json format

&format=xml
or
&format=json


&path=

REQUIRED

The path query parameter relates to what would be the RESTful path of the required data elements. The current path cariables available are below

Massey Event system data

  • &path=events/events

    The event items stored in the event system

  • &path=events/types

    The 'types' of events available

  • &path=events/categories

    The categorisation tags for the events system

Massey News system data
  • &path=news/articles

    The news articles in the news system

  • &path=news/types

    The 'types' of news articles available

  • &path=news/categories

    The categorisation tags for the news system

Massey directory data
  • &path=people/people

    Available data from the directory system


&args=

Arguments are submitted as semi-colon separated pairs and used to order/filter the returned results

&args=key1:value1;key2:value2;key3:value3a,value3b,value3c;

&args=limit:5;color:blue;sizes:xl,l,s;

News

news/articles

www.massey.ac.nz/api/v1/massey.cfc?method=get&apikey={YOUR API KEY}&format=json&path=news/articles&args=....

Arguments

  • uuid
    Return article that has this specific UUID
  • slug
    Return article that has this specific slug
  • type_uuid
    Return articles that are of a specific type. FORMAT: GUID
  • from_date
    Return articles created after a date. FORMAT:'yyyy-mm-dd'
  • to_date
    Return articles created before a date. FORMAT:'yyyy-mm-dd'
  • categories
    Return articles that belong to the specified categories. FORMAT: GUID,GUID,...
  • fields
    If specified the service will return only these fields: valid fields listed below
  • search_term
    If specified the service will return items whose title field contains the keyword
  • order_by
    The fields to order the results by
  • order_dir The direction of the ordering. Default: 'ASC'
  • limit The maximum number of results to return. Default: 20
Valid return feilds
  • created *
  • modified *
  • uuid *
  • type_uuid *
  • title *
  • type *
  • summary *
  • thumbnail *
  • slug *
  • released *
  • body
  • image

Retrieve XML data for 2 most recent articles ... View Results
http://www.massey.ac.nz/api/v1/massey.cfc?method=get&apikey={YOUR API KEY}&path=news/articles&args=limit:2

Retrieve JSON data for most 'University News' type story (uuid='B3A8EBA9-96BF-57F6-8177-280EBC969D8D') ... View Results
http://www.massey.ac.nz/api/v1/massey.cfc?method=get&apikey={YOUR API KEY}&format=json
&path=news/articles&args=limit:1;type_uuid:B3A8EBA9-96BF-57F6-8177-280EBC969D8D

Retrieve JSON data for a specific article View Results
http://www.massey.ac.nz/api/v1/massey.cfc?method=get&apikey={YOUR API KEY}&format=json
&path=news/articles&args=uuid:FAF3C6BF-EDF0-7245-DD2A-8A86E1B7CE1C


news/types

www.massey.ac.nz/api/v1/massey.cfc?method=get&apikey={YOUR API KEY}&format=json&path=news/types&args=....

Arguments

  • uuid
    If specified the service will the specified type entry. Format: GUID
  • search_term
    If specified the service will return items whose label field matches the keyword
  • order_by
    The fields to order the results by
  • order_dir The direction of the ordering. Default: 'ASC'
  • limit The maximum number of results to return
Valid return feilds
  • label *
  • obj_uuid *

Retrieve all types ... View Results
http://www.massey.ac.nz/api/v1/massey.cfc?method=get&apikey={YOUR API KEY}&format=json&path=news/types


news/categories

www.massey.ac.nz/api/v1/massey.cfc?method=get&apikey={YOUR API KEY}&format=json&path=news/categories&args=....

Arguments

  • uuid
    If specified the service will the specified type entry. Format: GUID
  • search_term
    If specified the service will return items whose label field matches the keyword
  • order_by
    The fields to order the results by
  • order_dir The direction of the ordering. Default: 'ASC'
  • limit The maximum number of results to return
Valid return feilds
  • label *
  • obj_uuid *

Retrieve all categories ... View Results
http://www.massey.ac.nz/api/v1/massey.cfc?method=get&apikey={YOUR API KEY}&format=json&path=news/categories

Events

events/events

www.massey.ac.nz/api/v1/massey.cfc?method=get&apikey={YOUR API KEY}&format=json&path=events/events&args=....

Arguments

  • exclude_expired
    Do not return expired events. Format:BIT (1/0), Default:1
  • type_uuid
    Return events that are of a specific type. FORMAT: GUID
  • from_date
    Return events starting after a date. FORMAT:'yyyy-mm-dd'
  • to_date
    Return events finishing before a date. FORMAT:'yyyy-mm-dd'
  • categories
    Return events that belong to the specified categories. FORMAT: GUID,GUID,...
  • fields
    If specified the service will return only these fields: valid fields listed below
  • search_term
    If specified the service will return items whose label field matches the keyword
  • order_by
    The fields to order the results by. Default: 'gen_start_dt'
  • order_dir The direction of the ordering. Default: 'ASC'
  • limit The maximum number of results to return. Default: 20
Valid return feilds
  • uuid *
  • title *
  • thumbnail *
  • summary *
  • dates *
  • released
  • modified
  • created
  • body


events/types

www.massey.ac.nz/api/v1/massey.cfc?method=get&apikey={YOUR API KEY}&format=json&path=events/types&args=....

Arguments

  • uuid
    If specified the service will the specified type entry. Format: GUID
  • search_term
    If specified the service will return items whose label field matches the keyword
  • order_by
    The fields to order the results by
  • order_dir The direction of the ordering. Default: 'ASC'
  • limit The maximum number of results to return
Valid return feilds
  • label *
  • obj_uuid *

Retrieve all types ... View Results
http://www.massey.ac.nz/api/v1/massey.cfc?method=get&apikey={YOUR API KEY}&format=json&path=events/types


events/categories

www.massey.ac.nz/api/v1/massey.cfc?method=get&apikey={YOUR API KEY}&format=json&path=events/categories&args=....

Arguments

  • uuid
    If specified the service will the specified type entry. Format: GUID
  • search_term
    If specified the service will return items whose label field matches the keyword
  • order_by
    The fields to order the results by
  • order_dir The direction of the ordering. Default: 'ASC'
  • limit The maximum number of results to return
Valid return feilds
  • label *
  • obj_uuid *

Retrieve all categories ... View Results
http://www.massey.ac.nz/api/v1/massey.cfc?method=get&apikey={YOUR API KEY}&format=json&path=events/categories

People

people/people

www.massey.ac.nz/api/v1/massey.cfc?method=get&apikey={YOUR API KEY}&format=json&path=people/people&args=....

Arguments

  • search_term
    If specified the service will remove any people whose names do not match the keyword
  • user_codes
    If specified the service will only return people with the specific user codes specified
  • ids
    If specified the service will only return people with the specific staff ids specified
  • fields
    If specified the service will return only these fields: valid fields listed below
  • order_by
    The fields to order the results by
  • order_dir The direction of the ordering. Default: 'ASC'
  • limit The maximum number of results to return
Valid return feilds (* returned by default)
  • staff_id *
  • preferred_name *
  • last_name *
  • email *
  • extension *
  • known_as
  • position
  • title
  • user_code
  • blurb
  • image

Retrieve XML data for specific staff id ... View Results
http://www.massey.ac.nz/api/v1/massey.cfc?method=get&apikey={YOUR API KEY}&path=people/people&args=ids:039387

Retrieve names and extensions in JSON for specific user codes ... View Results
http://www.massey.ac.nz/api/v1/massey.cfc?method=get&apikey={YOUR API KEY}&format=json
&path=people/people&args=user_codes:bjwildbo,pjmoody;fields:known_as,extension

Retrieve names and extensions in JSON for all Richards ... View Results
http://www.massey.ac.nz/api/v1/massey.cfc?method=get&apikey={YOUR API KEY}&format=json
&path=people/people&args=search_term:richard;fields:known_as,extension