Kulturpunkt API v2 Documentation
Introduction
This REST API gives access to data from KulturPunkt to external applications.
The base url for all API functions is https://api.kulturpunkt.org/v2
Base url during development: https://dev-api.kulturpunkt.org/v2
Every API request requires a unique site key for your client. Contact KulturIT to obtain your site key. The site key should be submitted through the http header 'api-key'.
The API currently only accepts GET requests. Data is returned in JSON format.
Most of the requests will return a status called 'result', which contains either 'success' or 'failed'. If it fails, an error is located in 'reason'. If it succeeds, the data returned is wrapped inside 'data'.
All of the text displayed to the end user can exist in multiple languages. The content in different languages are found in each elements' content object.
Architecture
The system’s structure consists of a hierarchy of the following elements: Owner (eier), group (webpresentasjon), presentation (visning), member, record (kulturpunkt), page (side) and block. These elements are described below.
- Owner – Usually a museum or an institution. Most API clients only have access to one owner.
- Group – Within an owner you may want a way to separate different types of content. Groups are the way to do that. A group is basically a collection of presentations.
- Presentation – A presentation is where you find the actual objects. We currently have three types of presentations:
- Theme – A theme is a collection of objects in a flat structure, with a theme that they all have in common. Examples are Paintings, Edvard Munch and Oslo. The objects have a position within the presentation.
- Map – A geographic map with objects placed with latitude/longitude
- Tour – Same as map, but in addition to a placement on the map, the objects are organized in routes, determined by their position
All of the published records can have relationships to each other, regardless of the presentations they appear in. Records can have multiple children and/or multiple parents.
- (Member – A member is an entity that represents a record in a presentation. The member holds the record, in addition to presentation-specific attributes like position and map coordinates)
- Record – The main object (a kulturpunkt is a record). A record can have a image, title and description in multiple languages (under 'content'). A record can be a building, a painting, a person, or similar. The rest of the content is located in the record's pages.
- Language - An abstract level. Each page belongs to one (and only one) language.
- Page – Pages belong to a record. A record can have multiple pages. Pages are the main container for contents, organized in content blocks. Having more than one page in each record is not recommended.
- Block - Blocks of content. See "Types" for the different types of blocks. The type "image_video" can contain a mix of images and videos.
All of the identifiers (ids) are continuous counting integers, meaning they don't start at 1 under each parent element. For instance, a record with id 1 may have two pages with id 1 and 2, and pages under a record with id 3 may have the ids 3 and 4.
"Types"
Some of the elements have a type attribute, or other attributes with predefined values, which may give the element different properties, or may need a translation in your application.
The different elements and types are:
- License (Creative Commons + copyright)
- Description: "Copyright", code: "copyright"
- Description: "Attribution-NonCommercial-NoDerivs", code: "by-nc-nd"
- Description: "Attribution-NonCommercial-ShareAlike", code: "by-nc-sa"
- Description: "Attribution-ShareAlike", code: "by-sa"
- Description: "Attribution-NoDerivs", code: "by-nd"
- Description: "Attribution-NonCommercial", code: "by-nc"
- Description: "Attribution", code: "by"
- Description: "Public Domain Dedication", code: "pdd"
- Description: "Public Domain Mark", code: "pdm"
- Resource - Type
- "image", "audio", "video", "youtube", "vimeo", "document", "sketchfab", "other"
- Credit - Type
- "photographer", "artist", "author", "director", "voice", "owner"
- Presentation - Type
- "map_google", "tour", "theme"
- "map_google", "tour", "theme"
- Block - Type
- "text", "links", "audio", "image_video", "document"
Multimedia
Images are served as .jpg.
Videos are converted to and served as mp4, webm and ogv, and a thumbnail is generated.
Audio are converted to and served as mp3.
URL examples
https://api.kulturpunkt.org/v2/owners/
https://api.kulturpunkt.org/v2/owners/1
https://api.kulturpunkt.org/v2/owners/1/groups/1
https://api.kulturpunkt.org/v2/owners/1/presentations/2
https://api.kulturpunkt.org/v2/owners/1/records/2?presentation_id=2
API Endpoints
Get records nearby
/v2/record/nearbyGET Returns records nearby a specified location Example: https://api.kulturpunkt.org/v2/record/nearby?location=61.108960,10.466015&start=10&rows=10&owner_id=18&radius=20000
|
---|
Get records for map
/v2/record/mapGET Returns records with a location, optionally belonging to a specific owner Example: https://api.kulturpunkt.org/v2/record/map?location=59.908452,10.676749&owner_id=46
|
---|
Get simple records for map
/v2/record/map/simpleGET Returns list with simple version of the records for a map, with location, distance, owner_id and id - optionally belonging to a specific owner Example: https://api.kulturpunkt.org/v2/record/map/simple?location=59.908452,10.676749&owner_id=46
|
---|
Get owners nearby
/v2/owner/nearbyGET Returns owner nearby a specified location Example: https://api.kulturpunkt.org/v2/owner/nearby?location=61.108960,10.466015&start=0&rows=5
|
---|
Get all owners
/v2/owners/GETReturns all owners Parameters: None |
---|
Get one owner, with groups
/v2/owners/<owner_id>GETReturns one owner, with groups
|
---|
Get one group, with presentations
/v2/owners/<owner_id>/groups/<group_id>GET Returns one group, with presentations and their metadata
|
---|
Get one presentation, with records
/v2/owners/<owner_id>/presentations/<presentation_id>GET Returns one presentation, with records and their metadata
|
---|
Get one record
/v2/owners/<owner_id>/groups/<group_id>/records/<record_id>GET Returns a published record, with its content, pages, location and license, along with related records and the presentation(s) it belongs to.
Example: /v2/owners/1/groups/4/records/2?presentation_id=3 |
---|
Comments: All_presentations contains all of the presentations the record is a member of.
Presentation contains the presentation specified in parameter presentation_id.
Children contains related records, usually meaning something like "These are naturally the next records to check out!"
Parents also contains related records, but these are records that naturally leads to this one (previous).
Get simple record
/v2/owners/<owner_id>/records/<record_id>/simpleGET Returns a simple version of one record Example: https://api.kulturpunkt.org/v2/owners/51/records/5085/simple Parameters: None |
---|
Get geographically placed records from a group
/v2/owners/<owner_id>/groups/<group_id>/geographyGET Returns all records within a published presentation in a group, that have geographic coordinates. Returns record metadata (id, title, description and coordinates). This can for instance be used to make a map over an entire group.
|
---|
Get records nearby a specified location, within a specific group
/v2/owners/<owner_id>/groups/<group_id>/nearbyGET Returns all published, geographically placed records within a specified radius of a specific geographic point.
Example: /v2/owners/1/groups/1/nearby?lat=60.927227&long=10.697916&radius=20000 |
---|
Get record from code
/v2/code/<code>GET Get record data associated with a code Example: https://api.kulturpunkt.org/v2/code/abc123
|
---|
Get record from beacon
/v2/beaconGET Get record data associated with a beacon
|
---|
Get all beacons (not available for all clients)
/v2/beacon/allGET Get all beacons associated with published records Example: http://api.kulturpunkt.org/v2/beacon/all No parameters needed |
---|
NOT READY YET:
Search records
/v2/owners/<owner_id>/searchGet Returns all records with a title matching a search string. If a group id is specified, only records from this group are returned. Otherwise, all of the owner's records are queried. Records are queried with a simple "LIKE" on their language specific titles.
Example: /v2/owners/1/search?q=punkt%203&lang=no&group_id=1 |
---|
Comments: If group_id is omitted, all of the owner's records are queried.