Open Data API v1
The Open Data API provides the same information about initiatives as the site's user interface does. This service contains three Open Data access points: one for listing public initiatives, one for details of an individual initiative and one for receiving municipalities. All interfaces support JSON and JSONP formats.
List of Initiatives
https:////testi.kuntalaisaloite.fi/api/v1/initiatives
Returns a list of initiatives with Basic properties. Id of an initiative is an URI of initiative details in JSON format.
Parameters offset and limit may be used to restrict the results. 20 initiatives will be returned by default. Maximum amount of initiatives to return is 50.
Results might be ordered with parameter orderBy. Possible values are oldestSent, latestSent, id, mostParticipants, leastParticipants, oldest and latest.
If municipality parameter is given, only initiatives for given municipality id are returned.
Initiative Details
https://testi.kuntalaisaloite.fi/api/v1/initiatives/{id}
Details of the initiative in JSON format.
Municipalities
All municipalities are listed at https:////testi.kuntalaisaloite.fi/api/v1/municipalities.
JSONP
All interfaces support also JSONP format. Callback is given with jsonp parameter. E.g.
https:////testi.kuntalaisaloite.fi/api/v1/initiatives?jsonp=myCallback.
Initiative Details
Example | Data Type | Description |
---|---|---|
{ | ||
"authors":{ | Object | Information about the authors of the initiative |
"privateNames":1, | Integer | Amount of authors who have not published their names |
"publicAuthors":[ | Array | List of public authors |
{ | ||
"municipality":{ | Object | Authors home municipality |
"active":false, | boolean | Is municipality active in the service |
"id":"https:////testi.kuntalaisaloite.fi/api/v1/municipalities/1", | String (URI) | URI for the municipality |
"nameFi":"Tampere", | String | Name of the municipality in finnish |
"nameSv":"Tammerfors" | String | Name of the municipality in swedish |
}, | ||
"name":"Teemu Teekkari" | String | Authors name |
}] | ||
, | ||
"publicNames":1 | Integer | Amount of public authors |
}, | ||
"collaborative":true, | Boolean | Is people able to participate to the initiative |
"id":"https:////testi.kuntalaisaloite.fi/api/v1/initiatives/1", | String (URI) | URI of this object |
"municipality":{ | Object | The municipality where the initiative is oriented to |
"active":false, | boolean | Is municipality active in the service |
"id":"https:////testi.kuntalaisaloite.fi/api/v1/municipalities/1", | String (URI) | URI for the municipality |
"nameFi":"Tampere", | String | Name of the municipality in finnish |
"nameSv":"Tammerfors" | String | Name of the municipality in swedish |
}, | ||
"name":"Tämä on esimerkkialoitteen otsikko", | String | Subject of the initiative |
"participantCount":{ | Object | Amount of participants if collaborative initiative |
"externalNames":0, | Integer | Amount of participants gathered elsewhere |
"privateNames":10, | Integer | Amount of participants who has not given their name for publishing |
"publicNames":1, | Integer | Amount of participants who has marked their name public |
"total":11 | Integer | Total amount of participants (public+private+external) |
}, | ||
"proposal":"Tämä on esimerkkialoitteen sisältö", | String | Proposal of the initiative |
"publishDate":"2010-01-01", | String (xsd:date) | Date when the initiative is published |
"sentTime":null, | String (xsd:date) | null | Date when the initiative is sent to the municipality or null if not yet sent. |
"type":"COLLABORATIVE", | Enum (SINGLE, COLLABORATIVE, COLLABORATIVE_CITIZEN) | Type of the initiative |
"url":{ | Object | URL:s to initiatives public page |
"fi":"https://testi.kuntalaisaloite.fi/fi/aloite/1", | String | Finnish URL |
"sv":"https://testi.kuntalaisaloite.fi/sv/initiativ/1" | String | Swedish URL |
} | ||
} |
Basic properties for initiative list
Example | Data Type | Description |
---|---|---|
[ | ||
{ | ||
"collaborative":true, | Boolean | Is people able to participate to the initiative |
"id":"https:////testi.kuntalaisaloite.fi/api/v1/initiatives/1", | String (URI) | URI of this object |
"municipality":{ | Object | The municipality where the initiative is oriented to |
"active":false, | boolean | Is municipality active in the service |
"id":"https:////testi.kuntalaisaloite.fi/api/v1/municipalities/1", | String (URI) | URI for the municipality |
"nameFi":"Tampere", | String | Name of the municipality in finnish |
"nameSv":"Tammerfors" | String | Name of the municipality in swedish |
}, | ||
"name":"Tämä on esimerkkialoitteen otsikko", | String | Subject of the initiative |
"participantCount":2, | Object | Amount of participants if collaborative initiative |
"publishDate":"2012-12-01", | String (xsd:date) | Date when the initiative is published |
"sentTime":"2012-12-24", | String (xsd:date) | null | Date when the initiative is sent to the municipality or null if not yet sent. |
"type":"COLLABORATIVE_CITIZEN", | Enum (SINGLE, COLLABORATIVE, COLLABORATIVE_CITIZEN) | Type of the initiative |
"url":{ | Object | URL:s to initiatives public page |
"fi":"https://testi.kuntalaisaloite.fi/fi/aloite/1", | String | Finnish URL |
"sv":"https://testi.kuntalaisaloite.fi/sv/initiativ/1" | String | Swedish URL |
} | ||
}] |
Municipalities
Example | Data Type | Description |
---|---|---|
[ | ||
{ | ||
"active":false, | boolean | Is municipality active in the service |
"id":"https:////testi.kuntalaisaloite.fi/api/v1/municipalities/1", | String (URI) | URI of this object |
"nameFi":"Tampere", | String | Name of the municipality in finnish |
"nameSv":"Tammerfors" | String | Name of the municipality in swedish |
}] |