Species Observation System API
API change historySpecies Observation System API V1.5. The Species Observation System GitHub repository contains source code and documentation.
Observations_MetricGridAggregation
Aggregates observations into grid cells. Each grid cell contains the number of observations and the number of unique taxa (usually species) in the grid cell. The grid cells are squares in SWEREF 99 TM coordinate system
Try itRequest
Request URL
Request parameters
-
(optional)integer
Format - int32. Format - int32. Format - int32. Format - int32. Format - int32. Format - int32. Size of grid cell in meters
-
(optional)boolean
If true, validation of search filter values will be made. I.e. HTTP bad request response will be sent if there are invalid parameter values.
-
(optional)boolean
If true, only sensitive (protected) observations will be searched (this requires authentication and authorization). If false, public available observations will be searched.
Request headers
-
(optional)integer
Format - int32. Format - int32. Format - int32. Format - int32. Format - int32. Format - int32. Limit user authorization too specified role
-
(optional)string
Name of application used in authorization.
-
(optional)string
The requested API version
-
(optional)string
Name of system doing the request
-
(optional)stringMedia type of the body sent to the API.
-
stringOAuth 2.0 access token obtained from ids.artdatabanken.se. Supported grant types: Authorization code.
Request body
The search filter.
{
"birdNestActivityLimit": 0,
"dataProvider": {
"ids": [
0
]
},
"date": {
"startDate": "string",
"endDate": "string",
"dateFilterType": "OverlappingStartDateAndEndDate",
"timeRanges": [
"Morning"
]
},
"determinationFilter": "NoFilter",
"diffusionStatuses": [
"NotDiffused"
],
"geographics": {
"areas": [
{
"areaType": "Municipality",
"featureId": "string"
}
],
"boundingBox": {
"bottomRight": {
"latitude": 0,
"longitude": 0
},
"topLeft": {
"latitude": 0,
"longitude": 0
}
},
"maxDistanceFromPoint": 0,
"geometries": [
{
"type": "string"
}
],
"considerDisturbanceRadius": true,
"considerObservationAccuracy": true,
"maxAccuracy": 0
},
"modifiedDate": {
"from": "string",
"to": "string"
},
"notRecoveredFilter": "NoFilter",
"observedByMe": true,
"occurrenceStatus": "Present",
"projectIds": [
0
],
"reportedByMe": true,
"taxon": {
"includeUnderlyingTaxa": true,
"ids": [
0
],
"taxonListIds": [
0
],
"redListCategories": [
"string"
],
"taxonCategories": [
0
],
"taxonListOperator": "Merge"
},
"validationStatus": "BothValidatedAndNotValidated",
"verificationStatus": "BothVerifiedAndNotVerified"
}
{
"type": "object",
"properties": {
"birdNestActivityLimit": {
"type": "integer",
"description": "Limit returned observations based on bird nest activity level.\r\nOnly bird observations in Artportalen are affected\r\nby this search criteria.\r\nObservation of other organism groups (not birds) are\r\nnot affected by this search criteria.",
"format": "int32",
"nullable": true
},
"dataProvider": {
"type": "object",
"properties": {
"ids": {
"type": "array",
"items": {
"type": "integer",
"format": "int32"
},
"description": "Data provider id's",
"nullable": true
}
},
"additionalProperties": false,
"description": "Data provider filter."
},
"date": {
"type": "object",
"properties": {
"startDate": {
"type": "string",
"description": "Observation start date specified in the ISO 8601 standard. If no timezone is specified, GMT+1 (CEST) is assumed",
"format": "date-time",
"nullable": true
},
"endDate": {
"type": "string",
"description": "Observation end date specified in the ISO 8601 standard. If no timezone is specified, GMT+1 (CEST) is assumed",
"format": "date-time",
"nullable": true
},
"dateFilterType": {
"enum": [
"OverlappingStartDateAndEndDate",
"BetweenStartDateAndEndDate",
"OnlyStartDate",
"OnlyEndDate"
],
"type": "string",
"description": "OverlappingStartDateAndEndDate, Start or EndDate of the observation must be within the specified interval \r\nBetweenStartDateAndEndDate, Start and EndDate of the observation must be within the specified interval \r\nOnlyStartDate, Only StartDate of the observation must be within the specified interval \r\nOnlyEndDate, Only EndDate of the observation must be within the specified interval"
},
"timeRanges": {
"type": "array",
"items": {
"enum": [
"Morning",
"Forenoon",
"Afternoon",
"Evening",
"Night"
],
"type": "string"
},
"description": "Predefined time ranges",
"nullable": true
}
},
"additionalProperties": false,
"description": "Date filter."
},
"determinationFilter": {
"enum": [
"NoFilter",
"NotUnsureDetermination",
"OnlyUnsureDetermination"
],
"type": "string"
},
"diffusionStatuses": {
"type": "array",
"items": {
"enum": [
"NotDiffused",
"DiffusedBySystem",
"DiffusedByProvider"
],
"type": "string",
"description": "Diffuse status dto"
},
"description": "Filter by diffusion status.",
"nullable": true
},
"geographics": {
"type": "object",
"properties": {
"areas": {
"type": "array",
"items": {
"type": "object",
"properties": {
"areaType": {
"enum": [
"Municipality",
"Community",
"Sea",
"CountryRegion",
"NatureType",
"Province",
"Ramsar",
"BirdValidationArea",
"Parish",
"Spa",
"County",
"ProtectedNature",
"SwedishForestAgencyDistricts",
"Sci",
"WaterArea",
"Atlas5x5",
"Atlas10x10"
],
"type": "string",
"description": "Area type dto"
},
"featureId": {
"type": "string",
"description": "Feature",
"nullable": true
}
},
"additionalProperties": false,
"description": "Area filter."
},
"description": "Area filter",
"nullable": true
},
"boundingBox": {
"type": "object",
"properties": {
"bottomRight": {
"type": "object",
"properties": {
"latitude": {
"type": "number",
"format": "double"
},
"longitude": {
"type": "number",
"format": "double"
}
},
"additionalProperties": false
},
"topLeft": {
"type": "object",
"properties": {
"latitude": {
"type": "number",
"format": "double"
},
"longitude": {
"type": "number",
"format": "double"
}
},
"additionalProperties": false
}
},
"additionalProperties": false
},
"maxDistanceFromPoint": {
"type": "number",
"description": "If Geometries is of point type, this property must be set to a value greater than 0.\r\nObservations inside circle (center=point, radius=MaxDistanceFromPoint) will be returned.",
"format": "double",
"nullable": true
},
"geometries": {
"type": "array",
"items": {
"type": "object",
"properties": {
"type": {
"type": "string",
"nullable": true,
"readOnly": true
}
},
"additionalProperties": false
},
"description": "Point or polygon geometry used for search.\r\nIf the geometry is a point, then MaxDistanceFromPoint is also used in search.",
"nullable": true
},
"considerDisturbanceRadius": {
"type": "boolean",
"description": "If true, observations that are outside Geometries polygons\r\nbut close enough when disturbance sensitivity of species\r\nare considered, will be included in the result."
},
"considerObservationAccuracy": {
"type": "boolean",
"description": "If true, observations that are outside Geometries polygons\r\nbut possibly inside when accuracy (coordinateUncertaintyInMeters)\r\nof observation is considered, will be included in the result."
},
"maxAccuracy": {
"type": "integer",
"description": "Limit observation accuracy. Only observations with accuracy less than this will be returned",
"format": "int32",
"nullable": true
}
},
"additionalProperties": false,
"description": "Geometry filter."
},
"modifiedDate": {
"type": "object",
"properties": {
"from": {
"type": "string",
"description": "Changed from",
"format": "date-time",
"nullable": true
},
"to": {
"type": "string",
"description": "Changed tp",
"format": "date-time",
"nullable": true
}
},
"additionalProperties": false,
"description": "Filter for observation Modified date"
},
"notRecoveredFilter": {
"enum": [
"NoFilter",
"OnlyNotRecovered",
"DontIncludeNotRecovered"
],
"type": "string"
},
"observedByMe": {
"type": "boolean",
"description": "Only get observations observed by me"
},
"occurrenceStatus": {
"enum": [
"Present",
"Absent",
"BothPresentAndAbsent"
],
"type": "string",
"description": "Possible values for the OccurrenceStatus filter."
},
"projectIds": {
"type": "array",
"items": {
"type": "integer",
"format": "int32"
},
"description": "Project id's to match.",
"nullable": true
},
"reportedByMe": {
"type": "boolean",
"description": "Only get observations reported by me"
},
"taxon": {
"type": "object",
"properties": {
"includeUnderlyingTaxa": {
"type": "boolean",
"description": "If true, also include the underlying hierarchical taxa in search.\r\nE.g. If ids=[4000104](Aves) and includeUnderlyingTaxa=true, then you search for all birds."
},
"ids": {
"type": "array",
"items": {
"type": "integer",
"format": "int32"
},
"description": "Dyntaxa taxon id's to match.",
"nullable": true
},
"taxonListIds": {
"type": "array",
"items": {
"type": "integer",
"format": "int32"
},
"description": "Add (merge) or filter taxa by using taxon lists.",
"nullable": true
},
"redListCategories": {
"type": "array",
"items": {
"type": "string"
},
"description": "Redlist categories to match.\r\nPossible values are: \"DD\", \"EX\", \"RE\", \"CR\", \"EN\", \"VU\", \"NT\", \"LC\", \"NA\", \"NE\"",
"nullable": true
},
"taxonCategories": {
"type": "array",
"items": {
"type": "integer",
"format": "int32"
},
"description": "Taxon categories to match.",
"nullable": true
},
"taxonListOperator": {
"enum": [
"Merge",
"Filter"
],
"type": "string",
"description": "Operator to use when TaxonListIds is specified."
}
},
"additionalProperties": false,
"description": "Taxon filter."
},
"validationStatus": {
"enum": [
"BothValidatedAndNotValidated",
"Validated",
"NotValidated"
],
"type": "string"
},
"verificationStatus": {
"enum": [
"BothVerifiedAndNotVerified",
"Verified",
"NotVerified"
],
"type": "string"
}
},
"additionalProperties": false,
"description": "Search filter for aggregations"
}
{
"birdNestActivityLimit": 0,
"dataProvider": {
"ids": [
0
]
},
"date": {
"startDate": "string",
"endDate": "string",
"dateFilterType": "OverlappingStartDateAndEndDate",
"timeRanges": [
"Morning"
]
},
"determinationFilter": "NoFilter",
"diffusionStatuses": [
"NotDiffused"
],
"geographics": {
"areas": [
{
"areaType": "Municipality",
"featureId": "string"
}
],
"boundingBox": {
"bottomRight": {
"latitude": 0,
"longitude": 0
},
"topLeft": {
"latitude": 0,
"longitude": 0
}
},
"maxDistanceFromPoint": 0,
"geometries": [
{
"type": "string"
}
],
"considerDisturbanceRadius": true,
"considerObservationAccuracy": true,
"maxAccuracy": 0
},
"modifiedDate": {
"from": "string",
"to": "string"
},
"notRecoveredFilter": "NoFilter",
"observedByMe": true,
"occurrenceStatus": "Present",
"projectIds": [
0
],
"reportedByMe": true,
"taxon": {
"includeUnderlyingTaxa": true,
"ids": [
0
],
"taxonListIds": [
0
],
"redListCategories": [
"string"
],
"taxonCategories": [
0
],
"taxonListOperator": "Merge"
},
"validationStatus": "BothValidatedAndNotValidated",
"verificationStatus": "BothVerifiedAndNotVerified"
}
{
"type": "object",
"properties": {
"birdNestActivityLimit": {
"type": "integer",
"description": "Limit returned observations based on bird nest activity level.\r\nOnly bird observations in Artportalen are affected\r\nby this search criteria.\r\nObservation of other organism groups (not birds) are\r\nnot affected by this search criteria.",
"format": "int32",
"nullable": true
},
"dataProvider": {
"type": "object",
"properties": {
"ids": {
"type": "array",
"items": {
"type": "integer",
"format": "int32"
},
"description": "Data provider id's",
"nullable": true
}
},
"additionalProperties": false,
"description": "Data provider filter."
},
"date": {
"type": "object",
"properties": {
"startDate": {
"type": "string",
"description": "Observation start date specified in the ISO 8601 standard. If no timezone is specified, GMT+1 (CEST) is assumed",
"format": "date-time",
"nullable": true
},
"endDate": {
"type": "string",
"description": "Observation end date specified in the ISO 8601 standard. If no timezone is specified, GMT+1 (CEST) is assumed",
"format": "date-time",
"nullable": true
},
"dateFilterType": {
"enum": [
"OverlappingStartDateAndEndDate",
"BetweenStartDateAndEndDate",
"OnlyStartDate",
"OnlyEndDate"
],
"type": "string",
"description": "OverlappingStartDateAndEndDate, Start or EndDate of the observation must be within the specified interval \r\nBetweenStartDateAndEndDate, Start and EndDate of the observation must be within the specified interval \r\nOnlyStartDate, Only StartDate of the observation must be within the specified interval \r\nOnlyEndDate, Only EndDate of the observation must be within the specified interval"
},
"timeRanges": {
"type": "array",
"items": {
"enum": [
"Morning",
"Forenoon",
"Afternoon",
"Evening",
"Night"
],
"type": "string"
},
"description": "Predefined time ranges",
"nullable": true
}
},
"additionalProperties": false,
"description": "Date filter."
},
"determinationFilter": {
"enum": [
"NoFilter",
"NotUnsureDetermination",
"OnlyUnsureDetermination"
],
"type": "string"
},
"diffusionStatuses": {
"type": "array",
"items": {
"enum": [
"NotDiffused",
"DiffusedBySystem",
"DiffusedByProvider"
],
"type": "string",
"description": "Diffuse status dto"
},
"description": "Filter by diffusion status.",
"nullable": true
},
"geographics": {
"type": "object",
"properties": {
"areas": {
"type": "array",
"items": {
"type": "object",
"properties": {
"areaType": {
"enum": [
"Municipality",
"Community",
"Sea",
"CountryRegion",
"NatureType",
"Province",
"Ramsar",
"BirdValidationArea",
"Parish",
"Spa",
"County",
"ProtectedNature",
"SwedishForestAgencyDistricts",
"Sci",
"WaterArea",
"Atlas5x5",
"Atlas10x10"
],
"type": "string",
"description": "Area type dto"
},
"featureId": {
"type": "string",
"description": "Feature",
"nullable": true
}
},
"additionalProperties": false,
"description": "Area filter."
},
"description": "Area filter",
"nullable": true
},
"boundingBox": {
"type": "object",
"properties": {
"bottomRight": {
"type": "object",
"properties": {
"latitude": {
"type": "number",
"format": "double"
},
"longitude": {
"type": "number",
"format": "double"
}
},
"additionalProperties": false
},
"topLeft": {
"type": "object",
"properties": {
"latitude": {
"type": "number",
"format": "double"
},
"longitude": {
"type": "number",
"format": "double"
}
},
"additionalProperties": false
}
},
"additionalProperties": false
},
"maxDistanceFromPoint": {
"type": "number",
"description": "If Geometries is of point type, this property must be set to a value greater than 0.\r\nObservations inside circle (center=point, radius=MaxDistanceFromPoint) will be returned.",
"format": "double",
"nullable": true
},
"geometries": {
"type": "array",
"items": {
"type": "object",
"properties": {
"type": {
"type": "string",
"nullable": true,
"readOnly": true
}
},
"additionalProperties": false
},
"description": "Point or polygon geometry used for search.\r\nIf the geometry is a point, then MaxDistanceFromPoint is also used in search.",
"nullable": true
},
"considerDisturbanceRadius": {
"type": "boolean",
"description": "If true, observations that are outside Geometries polygons\r\nbut close enough when disturbance sensitivity of species\r\nare considered, will be included in the result."
},
"considerObservationAccuracy": {
"type": "boolean",
"description": "If true, observations that are outside Geometries polygons\r\nbut possibly inside when accuracy (coordinateUncertaintyInMeters)\r\nof observation is considered, will be included in the result."
},
"maxAccuracy": {
"type": "integer",
"description": "Limit observation accuracy. Only observations with accuracy less than this will be returned",
"format": "int32",
"nullable": true
}
},
"additionalProperties": false,
"description": "Geometry filter."
},
"modifiedDate": {
"type": "object",
"properties": {
"from": {
"type": "string",
"description": "Changed from",
"format": "date-time",
"nullable": true
},
"to": {
"type": "string",
"description": "Changed tp",
"format": "date-time",
"nullable": true
}
},
"additionalProperties": false,
"description": "Filter for observation Modified date"
},
"notRecoveredFilter": {
"enum": [
"NoFilter",
"OnlyNotRecovered",
"DontIncludeNotRecovered"
],
"type": "string"
},
"observedByMe": {
"type": "boolean",
"description": "Only get observations observed by me"
},
"occurrenceStatus": {
"enum": [
"Present",
"Absent",
"BothPresentAndAbsent"
],
"type": "string",
"description": "Possible values for the OccurrenceStatus filter."
},
"projectIds": {
"type": "array",
"items": {
"type": "integer",
"format": "int32"
},
"description": "Project id's to match.",
"nullable": true
},
"reportedByMe": {
"type": "boolean",
"description": "Only get observations reported by me"
},
"taxon": {
"type": "object",
"properties": {
"includeUnderlyingTaxa": {
"type": "boolean",
"description": "If true, also include the underlying hierarchical taxa in search.\r\nE.g. If ids=[4000104](Aves) and includeUnderlyingTaxa=true, then you search for all birds."
},
"ids": {
"type": "array",
"items": {
"type": "integer",
"format": "int32"
},
"description": "Dyntaxa taxon id's to match.",
"nullable": true
},
"taxonListIds": {
"type": "array",
"items": {
"type": "integer",
"format": "int32"
},
"description": "Add (merge) or filter taxa by using taxon lists.",
"nullable": true
},
"redListCategories": {
"type": "array",
"items": {
"type": "string"
},
"description": "Redlist categories to match.\r\nPossible values are: \"DD\", \"EX\", \"RE\", \"CR\", \"EN\", \"VU\", \"NT\", \"LC\", \"NA\", \"NE\"",
"nullable": true
},
"taxonCategories": {
"type": "array",
"items": {
"type": "integer",
"format": "int32"
},
"description": "Taxon categories to match.",
"nullable": true
},
"taxonListOperator": {
"enum": [
"Merge",
"Filter"
],
"type": "string",
"description": "Operator to use when TaxonListIds is specified."
}
},
"additionalProperties": false,
"description": "Taxon filter."
},
"validationStatus": {
"enum": [
"BothValidatedAndNotValidated",
"Validated",
"NotValidated"
],
"type": "string"
},
"verificationStatus": {
"enum": [
"BothVerifiedAndNotVerified",
"Verified",
"NotVerified"
],
"type": "string"
}
},
"additionalProperties": false,
"description": "Search filter for aggregations"
}
{
"birdNestActivityLimit": 0,
"dataProvider": {
"ids": [
0
]
},
"date": {
"startDate": "string",
"endDate": "string",
"dateFilterType": "OverlappingStartDateAndEndDate",
"timeRanges": [
"Morning"
]
},
"determinationFilter": "NoFilter",
"diffusionStatuses": [
"NotDiffused"
],
"geographics": {
"areas": [
{
"areaType": "Municipality",
"featureId": "string"
}
],
"boundingBox": {
"bottomRight": {
"latitude": 0,
"longitude": 0
},
"topLeft": {
"latitude": 0,
"longitude": 0
}
},
"maxDistanceFromPoint": 0,
"geometries": [
{
"type": "string"
}
],
"considerDisturbanceRadius": true,
"considerObservationAccuracy": true,
"maxAccuracy": 0
},
"modifiedDate": {
"from": "string",
"to": "string"
},
"notRecoveredFilter": "NoFilter",
"observedByMe": true,
"occurrenceStatus": "Present",
"projectIds": [
0
],
"reportedByMe": true,
"taxon": {
"includeUnderlyingTaxa": true,
"ids": [
0
],
"taxonListIds": [
0
],
"redListCategories": [
"string"
],
"taxonCategories": [
0
],
"taxonListOperator": "Merge"
},
"validationStatus": "BothValidatedAndNotValidated",
"verificationStatus": "BothVerifiedAndNotVerified"
}
{
"type": "object",
"properties": {
"birdNestActivityLimit": {
"type": "integer",
"description": "Limit returned observations based on bird nest activity level.\r\nOnly bird observations in Artportalen are affected\r\nby this search criteria.\r\nObservation of other organism groups (not birds) are\r\nnot affected by this search criteria.",
"format": "int32",
"nullable": true
},
"dataProvider": {
"type": "object",
"properties": {
"ids": {
"type": "array",
"items": {
"type": "integer",
"format": "int32"
},
"description": "Data provider id's",
"nullable": true
}
},
"additionalProperties": false,
"description": "Data provider filter."
},
"date": {
"type": "object",
"properties": {
"startDate": {
"type": "string",
"description": "Observation start date specified in the ISO 8601 standard. If no timezone is specified, GMT+1 (CEST) is assumed",
"format": "date-time",
"nullable": true
},
"endDate": {
"type": "string",
"description": "Observation end date specified in the ISO 8601 standard. If no timezone is specified, GMT+1 (CEST) is assumed",
"format": "date-time",
"nullable": true
},
"dateFilterType": {
"enum": [
"OverlappingStartDateAndEndDate",
"BetweenStartDateAndEndDate",
"OnlyStartDate",
"OnlyEndDate"
],
"type": "string",
"description": "OverlappingStartDateAndEndDate, Start or EndDate of the observation must be within the specified interval \r\nBetweenStartDateAndEndDate, Start and EndDate of the observation must be within the specified interval \r\nOnlyStartDate, Only StartDate of the observation must be within the specified interval \r\nOnlyEndDate, Only EndDate of the observation must be within the specified interval"
},
"timeRanges": {
"type": "array",
"items": {
"enum": [
"Morning",
"Forenoon",
"Afternoon",
"Evening",
"Night"
],
"type": "string"
},
"description": "Predefined time ranges",
"nullable": true
}
},
"additionalProperties": false,
"description": "Date filter."
},
"determinationFilter": {
"enum": [
"NoFilter",
"NotUnsureDetermination",
"OnlyUnsureDetermination"
],
"type": "string"
},
"diffusionStatuses": {
"type": "array",
"items": {
"enum": [
"NotDiffused",
"DiffusedBySystem",
"DiffusedByProvider"
],
"type": "string",
"description": "Diffuse status dto"
},
"description": "Filter by diffusion status.",
"nullable": true
},
"geographics": {
"type": "object",
"properties": {
"areas": {
"type": "array",
"items": {
"type": "object",
"properties": {
"areaType": {
"enum": [
"Municipality",
"Community",
"Sea",
"CountryRegion",
"NatureType",
"Province",
"Ramsar",
"BirdValidationArea",
"Parish",
"Spa",
"County",
"ProtectedNature",
"SwedishForestAgencyDistricts",
"Sci",
"WaterArea",
"Atlas5x5",
"Atlas10x10"
],
"type": "string",
"description": "Area type dto"
},
"featureId": {
"type": "string",
"description": "Feature",
"nullable": true
}
},
"additionalProperties": false,
"description": "Area filter."
},
"description": "Area filter",
"nullable": true
},
"boundingBox": {
"type": "object",
"properties": {
"bottomRight": {
"type": "object",
"properties": {
"latitude": {
"type": "number",
"format": "double"
},
"longitude": {
"type": "number",
"format": "double"
}
},
"additionalProperties": false
},
"topLeft": {
"type": "object",
"properties": {
"latitude": {
"type": "number",
"format": "double"
},
"longitude": {
"type": "number",
"format": "double"
}
},
"additionalProperties": false
}
},
"additionalProperties": false
},
"maxDistanceFromPoint": {
"type": "number",
"description": "If Geometries is of point type, this property must be set to a value greater than 0.\r\nObservations inside circle (center=point, radius=MaxDistanceFromPoint) will be returned.",
"format": "double",
"nullable": true
},
"geometries": {
"type": "array",
"items": {
"type": "object",
"properties": {
"type": {
"type": "string",
"nullable": true,
"readOnly": true
}
},
"additionalProperties": false
},
"description": "Point or polygon geometry used for search.\r\nIf the geometry is a point, then MaxDistanceFromPoint is also used in search.",
"nullable": true
},
"considerDisturbanceRadius": {
"type": "boolean",
"description": "If true, observations that are outside Geometries polygons\r\nbut close enough when disturbance sensitivity of species\r\nare considered, will be included in the result."
},
"considerObservationAccuracy": {
"type": "boolean",
"description": "If true, observations that are outside Geometries polygons\r\nbut possibly inside when accuracy (coordinateUncertaintyInMeters)\r\nof observation is considered, will be included in the result."
},
"maxAccuracy": {
"type": "integer",
"description": "Limit observation accuracy. Only observations with accuracy less than this will be returned",
"format": "int32",
"nullable": true
}
},
"additionalProperties": false,
"description": "Geometry filter."
},
"modifiedDate": {
"type": "object",
"properties": {
"from": {
"type": "string",
"description": "Changed from",
"format": "date-time",
"nullable": true
},
"to": {
"type": "string",
"description": "Changed tp",
"format": "date-time",
"nullable": true
}
},
"additionalProperties": false,
"description": "Filter for observation Modified date"
},
"notRecoveredFilter": {
"enum": [
"NoFilter",
"OnlyNotRecovered",
"DontIncludeNotRecovered"
],
"type": "string"
},
"observedByMe": {
"type": "boolean",
"description": "Only get observations observed by me"
},
"occurrenceStatus": {
"enum": [
"Present",
"Absent",
"BothPresentAndAbsent"
],
"type": "string",
"description": "Possible values for the OccurrenceStatus filter."
},
"projectIds": {
"type": "array",
"items": {
"type": "integer",
"format": "int32"
},
"description": "Project id's to match.",
"nullable": true
},
"reportedByMe": {
"type": "boolean",
"description": "Only get observations reported by me"
},
"taxon": {
"type": "object",
"properties": {
"includeUnderlyingTaxa": {
"type": "boolean",
"description": "If true, also include the underlying hierarchical taxa in search.\r\nE.g. If ids=[4000104](Aves) and includeUnderlyingTaxa=true, then you search for all birds."
},
"ids": {
"type": "array",
"items": {
"type": "integer",
"format": "int32"
},
"description": "Dyntaxa taxon id's to match.",
"nullable": true
},
"taxonListIds": {
"type": "array",
"items": {
"type": "integer",
"format": "int32"
},
"description": "Add (merge) or filter taxa by using taxon lists.",
"nullable": true
},
"redListCategories": {
"type": "array",
"items": {
"type": "string"
},
"description": "Redlist categories to match.\r\nPossible values are: \"DD\", \"EX\", \"RE\", \"CR\", \"EN\", \"VU\", \"NT\", \"LC\", \"NA\", \"NE\"",
"nullable": true
},
"taxonCategories": {
"type": "array",
"items": {
"type": "integer",
"format": "int32"
},
"description": "Taxon categories to match.",
"nullable": true
},
"taxonListOperator": {
"enum": [
"Merge",
"Filter"
],
"type": "string",
"description": "Operator to use when TaxonListIds is specified."
}
},
"additionalProperties": false,
"description": "Taxon filter."
},
"validationStatus": {
"enum": [
"BothValidatedAndNotValidated",
"Validated",
"NotValidated"
],
"type": "string"
},
"verificationStatus": {
"enum": [
"BothVerifiedAndNotVerified",
"Verified",
"NotVerified"
],
"type": "string"
}
},
"additionalProperties": false,
"description": "Search filter for aggregations"
}
Responses
200 OK
Success
Representations
{
"type": "object",
"properties": {
"boundingBox": {
"type": "object",
"properties": {
"bottomRight": {
"type": "object",
"properties": {
"latitude": {
"type": "number",
"format": "double"
},
"longitude": {
"type": "number",
"format": "double"
}
},
"additionalProperties": false
},
"topLeft": {
"type": "object",
"properties": {
"latitude": {
"type": "number",
"format": "double"
},
"longitude": {
"type": "number",
"format": "double"
}
},
"additionalProperties": false
}
},
"additionalProperties": false
},
"gridCells": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "Grid cell Id.",
"nullable": true
},
"boundingBox": {
"type": "object",
"properties": {
"bottomRight": {
"type": "object",
"properties": {
"latitude": {
"type": "number",
"format": "double"
},
"longitude": {
"type": "number",
"format": "double"
}
},
"additionalProperties": false
},
"topLeft": {
"type": "object",
"properties": {
"latitude": {
"type": "number",
"format": "double"
},
"longitude": {
"type": "number",
"format": "double"
}
},
"additionalProperties": false
}
},
"additionalProperties": false
},
"observationsCount": {
"type": "integer",
"description": "Number of observations in cell",
"format": "int64",
"nullable": true
},
"sweref99TmBoundingBox": {
"type": "object",
"properties": {
"bottomRight": {
"type": "object",
"properties": {
"x": {
"type": "number",
"format": "double"
},
"y": {
"type": "number",
"format": "double"
}
},
"additionalProperties": false
},
"topLeft": {
"type": "object",
"properties": {
"x": {
"type": "number",
"format": "double"
},
"y": {
"type": "number",
"format": "double"
}
},
"additionalProperties": false
}
},
"additionalProperties": false
},
"taxaCount": {
"type": "integer",
"description": "Count of different taxa",
"format": "int64",
"nullable": true
}
},
"additionalProperties": false,
"description": ""
},
"nullable": true
},
"gridCellCount": {
"type": "integer",
"format": "int32"
},
"gridCellSizeInMeters": {
"type": "integer",
"format": "int32"
},
"sweref99TmBoundingBox": {
"type": "object",
"properties": {
"bottomRight": {
"type": "object",
"properties": {
"x": {
"type": "number",
"format": "double"
},
"y": {
"type": "number",
"format": "double"
}
},
"additionalProperties": false
},
"topLeft": {
"type": "object",
"properties": {
"x": {
"type": "number",
"format": "double"
},
"y": {
"type": "number",
"format": "double"
}
},
"additionalProperties": false
}
},
"additionalProperties": false
}
},
"additionalProperties": false
}
{
"boundingBox": {
"bottomRight": {
"latitude": 0,
"longitude": 0
},
"topLeft": {
"latitude": 0,
"longitude": 0
}
},
"gridCells": [
{
"id": "string",
"boundingBox": {
"bottomRight": {
"latitude": 0,
"longitude": 0
},
"topLeft": {
"latitude": 0,
"longitude": 0
}
},
"observationsCount": 0,
"sweref99TmBoundingBox": {
"bottomRight": {
"x": 0,
"y": 0
},
"topLeft": {
"x": 0,
"y": 0
}
},
"taxaCount": 0
}
],
"gridCellCount": 0,
"gridCellSizeInMeters": 0,
"sweref99TmBoundingBox": {
"bottomRight": {
"x": 0,
"y": 0
},
"topLeft": {
"x": 0,
"y": 0
}
}
}
{
"type": "object",
"properties": {
"boundingBox": {
"type": "object",
"properties": {
"bottomRight": {
"type": "object",
"properties": {
"latitude": {
"type": "number",
"format": "double"
},
"longitude": {
"type": "number",
"format": "double"
}
},
"additionalProperties": false
},
"topLeft": {
"type": "object",
"properties": {
"latitude": {
"type": "number",
"format": "double"
},
"longitude": {
"type": "number",
"format": "double"
}
},
"additionalProperties": false
}
},
"additionalProperties": false
},
"gridCells": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "Grid cell Id.",
"nullable": true
},
"boundingBox": {
"type": "object",
"properties": {
"bottomRight": {
"type": "object",
"properties": {
"latitude": {
"type": "number",
"format": "double"
},
"longitude": {
"type": "number",
"format": "double"
}
},
"additionalProperties": false
},
"topLeft": {
"type": "object",
"properties": {
"latitude": {
"type": "number",
"format": "double"
},
"longitude": {
"type": "number",
"format": "double"
}
},
"additionalProperties": false
}
},
"additionalProperties": false
},
"observationsCount": {
"type": "integer",
"description": "Number of observations in cell",
"format": "int64",
"nullable": true
},
"sweref99TmBoundingBox": {
"type": "object",
"properties": {
"bottomRight": {
"type": "object",
"properties": {
"x": {
"type": "number",
"format": "double"
},
"y": {
"type": "number",
"format": "double"
}
},
"additionalProperties": false
},
"topLeft": {
"type": "object",
"properties": {
"x": {
"type": "number",
"format": "double"
},
"y": {
"type": "number",
"format": "double"
}
},
"additionalProperties": false
}
},
"additionalProperties": false
},
"taxaCount": {
"type": "integer",
"description": "Count of different taxa",
"format": "int64",
"nullable": true
}
},
"additionalProperties": false,
"description": ""
},
"nullable": true
},
"gridCellCount": {
"type": "integer",
"format": "int32"
},
"gridCellSizeInMeters": {
"type": "integer",
"format": "int32"
},
"sweref99TmBoundingBox": {
"type": "object",
"properties": {
"bottomRight": {
"type": "object",
"properties": {
"x": {
"type": "number",
"format": "double"
},
"y": {
"type": "number",
"format": "double"
}
},
"additionalProperties": false
},
"topLeft": {
"type": "object",
"properties": {
"x": {
"type": "number",
"format": "double"
},
"y": {
"type": "number",
"format": "double"
}
},
"additionalProperties": false
}
},
"additionalProperties": false
}
},
"additionalProperties": false
}
{
"boundingBox": {
"bottomRight": {
"latitude": 0,
"longitude": 0
},
"topLeft": {
"latitude": 0,
"longitude": 0
}
},
"gridCells": [
{
"id": "string",
"boundingBox": {
"bottomRight": {
"latitude": 0,
"longitude": 0
},
"topLeft": {
"latitude": 0,
"longitude": 0
}
},
"observationsCount": 0,
"sweref99TmBoundingBox": {
"bottomRight": {
"x": 0,
"y": 0
},
"topLeft": {
"x": 0,
"y": 0
}
},
"taxaCount": 0
}
],
"gridCellCount": 0,
"gridCellSizeInMeters": 0,
"sweref99TmBoundingBox": {
"bottomRight": {
"x": 0,
"y": 0
},
"topLeft": {
"x": 0,
"y": 0
}
}
}
{
"type": "object",
"properties": {
"boundingBox": {
"type": "object",
"properties": {
"bottomRight": {
"type": "object",
"properties": {
"latitude": {
"type": "number",
"format": "double"
},
"longitude": {
"type": "number",
"format": "double"
}
},
"additionalProperties": false
},
"topLeft": {
"type": "object",
"properties": {
"latitude": {
"type": "number",
"format": "double"
},
"longitude": {
"type": "number",
"format": "double"
}
},
"additionalProperties": false
}
},
"additionalProperties": false
},
"gridCells": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "Grid cell Id.",
"nullable": true
},
"boundingBox": {
"type": "object",
"properties": {
"bottomRight": {
"type": "object",
"properties": {
"latitude": {
"type": "number",
"format": "double"
},
"longitude": {
"type": "number",
"format": "double"
}
},
"additionalProperties": false
},
"topLeft": {
"type": "object",
"properties": {
"latitude": {
"type": "number",
"format": "double"
},
"longitude": {
"type": "number",
"format": "double"
}
},
"additionalProperties": false
}
},
"additionalProperties": false
},
"observationsCount": {
"type": "integer",
"description": "Number of observations in cell",
"format": "int64",
"nullable": true
},
"sweref99TmBoundingBox": {
"type": "object",
"properties": {
"bottomRight": {
"type": "object",
"properties": {
"x": {
"type": "number",
"format": "double"
},
"y": {
"type": "number",
"format": "double"
}
},
"additionalProperties": false
},
"topLeft": {
"type": "object",
"properties": {
"x": {
"type": "number",
"format": "double"
},
"y": {
"type": "number",
"format": "double"
}
},
"additionalProperties": false
}
},
"additionalProperties": false
},
"taxaCount": {
"type": "integer",
"description": "Count of different taxa",
"format": "int64",
"nullable": true
}
},
"additionalProperties": false,
"description": ""
},
"nullable": true
},
"gridCellCount": {
"type": "integer",
"format": "int32"
},
"gridCellSizeInMeters": {
"type": "integer",
"format": "int32"
},
"sweref99TmBoundingBox": {
"type": "object",
"properties": {
"bottomRight": {
"type": "object",
"properties": {
"x": {
"type": "number",
"format": "double"
},
"y": {
"type": "number",
"format": "double"
}
},
"additionalProperties": false
},
"topLeft": {
"type": "object",
"properties": {
"x": {
"type": "number",
"format": "double"
},
"y": {
"type": "number",
"format": "double"
}
},
"additionalProperties": false
}
},
"additionalProperties": false
}
},
"additionalProperties": false
}
400 Bad Request
Bad Request
Representations
{
"type": "object",
"properties": {
"type": {
"type": "string",
"nullable": true
},
"title": {
"type": "string",
"nullable": true
},
"status": {
"type": "integer",
"format": "int32",
"nullable": true
},
"detail": {
"type": "string",
"nullable": true
},
"instance": {
"type": "string",
"nullable": true
}
},
"additionalProperties": {}
}
{
"type": "string",
"title": "string",
"status": 0,
"detail": "string",
"instance": "string"
}
{
"type": "object",
"properties": {
"type": {
"type": "string",
"nullable": true
},
"title": {
"type": "string",
"nullable": true
},
"status": {
"type": "integer",
"format": "int32",
"nullable": true
},
"detail": {
"type": "string",
"nullable": true
},
"instance": {
"type": "string",
"nullable": true
}
},
"additionalProperties": {}
}
{
"type": "string",
"title": "string",
"status": 0,
"detail": "string",
"instance": "string"
}
{
"type": "object",
"properties": {
"type": {
"type": "string",
"nullable": true
},
"title": {
"type": "string",
"nullable": true
},
"status": {
"type": "integer",
"format": "int32",
"nullable": true
},
"detail": {
"type": "string",
"nullable": true
},
"instance": {
"type": "string",
"nullable": true
}
},
"additionalProperties": {}
}
401 Unauthorized
Unauthorized
Representations
{
"type": "object",
"properties": {
"type": {
"type": "string",
"nullable": true
},
"title": {
"type": "string",
"nullable": true
},
"status": {
"type": "integer",
"format": "int32",
"nullable": true
},
"detail": {
"type": "string",
"nullable": true
},
"instance": {
"type": "string",
"nullable": true
}
},
"additionalProperties": {}
}
{
"type": "string",
"title": "string",
"status": 0,
"detail": "string",
"instance": "string"
}
{
"type": "object",
"properties": {
"type": {
"type": "string",
"nullable": true
},
"title": {
"type": "string",
"nullable": true
},
"status": {
"type": "integer",
"format": "int32",
"nullable": true
},
"detail": {
"type": "string",
"nullable": true
},
"instance": {
"type": "string",
"nullable": true
}
},
"additionalProperties": {}
}
{
"type": "string",
"title": "string",
"status": 0,
"detail": "string",
"instance": "string"
}
{
"type": "object",
"properties": {
"type": {
"type": "string",
"nullable": true
},
"title": {
"type": "string",
"nullable": true
},
"status": {
"type": "integer",
"format": "int32",
"nullable": true
},
"detail": {
"type": "string",
"nullable": true
},
"instance": {
"type": "string",
"nullable": true
}
},
"additionalProperties": {}
}
500 Internal Server Error
Server Error
Code samples
@ECHO OFF
curl -v -X POST "https://api.artdatabanken.se/species-observation-system/v1/Observations/MetricGridAggregation?gridCellSizeInMeters=100000&validateSearchFilter=false&sensitiveObservations=false"
-H "X-Authorization-Role-Id: "
-H "X-Authorization-Application-Identifier: "
-H "X-Api-Version: 1.5"
-H "X-Requesting-System: "
-H "Content-Type: application/json"
-H "Ocp-Apim-Subscription-Key: {subscription key}"
-H "Authorization: {access token}"
--data-ascii "{body}"
using System;
using System.Net.Http.Headers;
using System.Text;
using System.Net.Http;
using System.Web;
namespace CSHttpClientSample
{
static class Program
{
static void Main()
{
MakeRequest();
Console.WriteLine("Hit ENTER to exit...");
Console.ReadLine();
}
static async void MakeRequest()
{
var client = new HttpClient();
var queryString = HttpUtility.ParseQueryString(string.Empty);
// Request headers
client.DefaultRequestHeaders.Add("X-Authorization-Role-Id", "");
client.DefaultRequestHeaders.Add("X-Authorization-Application-Identifier", "");
client.DefaultRequestHeaders.Add("X-Api-Version", "1.5");
client.DefaultRequestHeaders.Add("X-Requesting-System", "");
client.DefaultRequestHeaders.Add("Ocp-Apim-Subscription-Key", "{subscription key}");
client.DefaultRequestHeaders.Add("Authorization", "{access token}");
// Request parameters
queryString["gridCellSizeInMeters"] = "100000";
queryString["validateSearchFilter"] = "false";
queryString["sensitiveObservations"] = "false";
var uri = "https://api.artdatabanken.se/species-observation-system/v1/Observations/MetricGridAggregation?" + queryString;
HttpResponseMessage response;
// Request body
byte[] byteData = Encoding.UTF8.GetBytes("{body}");
using (var content = new ByteArrayContent(byteData))
{
content.Headers.ContentType = new MediaTypeHeaderValue("< your content type, i.e. application/json >");
response = await client.PostAsync(uri, content);
}
}
}
}
// // This sample uses the Apache HTTP client from HTTP Components (http://hc.apache.org/httpcomponents-client-ga/)
import java.net.URI;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.utils.URIBuilder;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;
public class JavaSample
{
public static void main(String[] args)
{
HttpClient httpclient = HttpClients.createDefault();
try
{
URIBuilder builder = new URIBuilder("https://api.artdatabanken.se/species-observation-system/v1/Observations/MetricGridAggregation");
builder.setParameter("gridCellSizeInMeters", "100000");
builder.setParameter("validateSearchFilter", "false");
builder.setParameter("sensitiveObservations", "false");
URI uri = builder.build();
HttpPost request = new HttpPost(uri);
request.setHeader("X-Authorization-Role-Id", "");
request.setHeader("X-Authorization-Application-Identifier", "");
request.setHeader("X-Api-Version", "1.5");
request.setHeader("X-Requesting-System", "");
request.setHeader("Content-Type", "application/json");
request.setHeader("Ocp-Apim-Subscription-Key", "{subscription key}");
request.setHeader("Authorization", "{access token}");
// Request body
StringEntity reqEntity = new StringEntity("{body}");
request.setEntity(reqEntity);
HttpResponse response = httpclient.execute(request);
HttpEntity entity = response.getEntity();
if (entity != null)
{
System.out.println(EntityUtils.toString(entity));
}
}
catch (Exception e)
{
System.out.println(e.getMessage());
}
}
}
<!DOCTYPE html>
<html>
<head>
<title>JSSample</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
</head>
<body>
<script type="text/javascript">
$(function() {
var params = {
// Request parameters
"gridCellSizeInMeters": "100000",
"validateSearchFilter": "false",
"sensitiveObservations": "false",
};
$.ajax({
url: "https://api.artdatabanken.se/species-observation-system/v1/Observations/MetricGridAggregation?" + $.param(params),
beforeSend: function(xhrObj){
// Request headers
xhrObj.setRequestHeader("X-Authorization-Role-Id","");
xhrObj.setRequestHeader("X-Authorization-Application-Identifier","");
xhrObj.setRequestHeader("X-Api-Version","1.5");
xhrObj.setRequestHeader("X-Requesting-System","");
xhrObj.setRequestHeader("Content-Type","application/json");
xhrObj.setRequestHeader("Ocp-Apim-Subscription-Key","{subscription key}");
xhrObj.setRequestHeader("Authorization","{access token}");
},
type: "POST",
// Request body
data: "{body}",
})
.done(function(data) {
alert("success");
})
.fail(function() {
alert("error");
});
});
</script>
</body>
</html>
#import <Foundation/Foundation.h>
int main(int argc, const char * argv[])
{
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
NSString* path = @"https://api.artdatabanken.se/species-observation-system/v1/Observations/MetricGridAggregation";
NSArray* array = @[
// Request parameters
@"entities=true",
@"gridCellSizeInMeters=100000",
@"validateSearchFilter=false",
@"sensitiveObservations=false",
];
NSString* string = [array componentsJoinedByString:@"&"];
path = [path stringByAppendingFormat:@"?%@", string];
NSLog(@"%@", path);
NSMutableURLRequest* _request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:path]];
[_request setHTTPMethod:@"POST"];
// Request headers
[_request setValue:@"" forHTTPHeaderField:@"X-Authorization-Role-Id"];
[_request setValue:@"" forHTTPHeaderField:@"X-Authorization-Application-Identifier"];
[_request setValue:@"1.5" forHTTPHeaderField:@"X-Api-Version"];
[_request setValue:@"" forHTTPHeaderField:@"X-Requesting-System"];
[_request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
[_request setValue:@"{subscription key}" forHTTPHeaderField:@"Ocp-Apim-Subscription-Key"];
[_request setValue:@"{access token}" forHTTPHeaderField:@"Authorization"];
// Request body
[_request setHTTPBody:[@"{body}" dataUsingEncoding:NSUTF8StringEncoding]];
NSURLResponse *response = nil;
NSError *error = nil;
NSData* _connectionData = [NSURLConnection sendSynchronousRequest:_request returningResponse:&response error:&error];
if (nil != error)
{
NSLog(@"Error: %@", error);
}
else
{
NSError* error = nil;
NSMutableDictionary* json = nil;
NSString* dataString = [[NSString alloc] initWithData:_connectionData encoding:NSUTF8StringEncoding];
NSLog(@"%@", dataString);
if (nil != _connectionData)
{
json = [NSJSONSerialization JSONObjectWithData:_connectionData options:NSJSONReadingMutableContainers error:&error];
}
if (error || !json)
{
NSLog(@"Could not parse loaded json with error:%@", error);
}
NSLog(@"%@", json);
_connectionData = nil;
}
[pool drain];
return 0;
}
<?php
// This sample uses the Apache HTTP client from HTTP Components (http://hc.apache.org/httpcomponents-client-ga/)
require_once 'HTTP/Request2.php';
$request = new Http_Request2('https://api.artdatabanken.se/species-observation-system/v1/Observations/MetricGridAggregation');
$url = $request->getUrl();
$headers = array(
// Request headers
'X-Authorization-Role-Id' => '',
'X-Authorization-Application-Identifier' => '',
'X-Api-Version' => '1.5',
'X-Requesting-System' => '',
'Content-Type' => 'application/json',
'Ocp-Apim-Subscription-Key' => '{subscription key}',
'Authorization' => '{access token}',
);
$request->setHeader($headers);
$parameters = array(
// Request parameters
'gridCellSizeInMeters' => '100000',
'validateSearchFilter' => 'false',
'sensitiveObservations' => 'false',
);
$url->setQueryVariables($parameters);
$request->setMethod(HTTP_Request2::METHOD_POST);
// Request body
$request->setBody("{body}");
try
{
$response = $request->send();
echo $response->getBody();
}
catch (HttpException $ex)
{
echo $ex;
}
?>
########### Python 2.7 #############
import httplib, urllib, base64
headers = {
# Request headers
'X-Authorization-Role-Id': '',
'X-Authorization-Application-Identifier': '',
'X-Api-Version': '1.5',
'X-Requesting-System': '',
'Content-Type': 'application/json',
'Ocp-Apim-Subscription-Key': '{subscription key}',
'Authorization': '{access token}',
}
params = urllib.urlencode({
# Request parameters
'gridCellSizeInMeters': '100000',
'validateSearchFilter': 'false',
'sensitiveObservations': 'false',
})
try:
conn = httplib.HTTPSConnection('api.artdatabanken.se')
conn.request("POST", "/species-observation-system/v1/Observations/MetricGridAggregation?%s" % params, "{body}", headers)
response = conn.getresponse()
data = response.read()
print(data)
conn.close()
except Exception as e:
print("[Errno {0}] {1}".format(e.errno, e.strerror))
####################################
########### Python 3.2 #############
import http.client, urllib.request, urllib.parse, urllib.error, base64
headers = {
# Request headers
'X-Authorization-Role-Id': '',
'X-Authorization-Application-Identifier': '',
'X-Api-Version': '1.5',
'X-Requesting-System': '',
'Content-Type': 'application/json',
'Ocp-Apim-Subscription-Key': '{subscription key}',
'Authorization': '{access token}',
}
params = urllib.parse.urlencode({
# Request parameters
'gridCellSizeInMeters': '100000',
'validateSearchFilter': 'false',
'sensitiveObservations': 'false',
})
try:
conn = http.client.HTTPSConnection('api.artdatabanken.se')
conn.request("POST", "/species-observation-system/v1/Observations/MetricGridAggregation?%s" % params, "{body}", headers)
response = conn.getresponse()
data = response.read()
print(data)
conn.close()
except Exception as e:
print("[Errno {0}] {1}".format(e.errno, e.strerror))
####################################
require 'net/http'
uri = URI('https://api.artdatabanken.se/species-observation-system/v1/Observations/MetricGridAggregation')
query = URI.encode_www_form({
# Request parameters
'gridCellSizeInMeters' => '100000',
'validateSearchFilter' => 'false',
'sensitiveObservations' => 'false'
})
if query.length > 0
if uri.query && uri.query.length > 0
uri.query += '&' + query
else
uri.query = query
end
end
request = Net::HTTP::Post.new(uri.request_uri)
# Request headers
request['X-Authorization-Role-Id'] = ''
# Request headers
request['X-Authorization-Application-Identifier'] = ''
# Request headers
request['X-Api-Version'] = '1.5'
# Request headers
request['X-Requesting-System'] = ''
# Request headers
request['Content-Type'] = 'application/json'
# Request headers
request['Ocp-Apim-Subscription-Key'] = '{subscription key}'
# Request headers
request['Authorization'] = '{access token}'
# Request body
request.body = "{body}"
response = Net::HTTP.start(uri.host, uri.port, :use_ssl => uri.scheme == 'https') do |http|
http.request(request)
end
puts response.body