Species Observation System API (Public)

API change history

Species Observation System API V1.5. The Species Observation System GitHub repository contains source code and documentation.

Locations_GetLocationsByIds

Get locations by id

Try it

Förfrågan

Begärans-URL

Begärandehuvud

  • (valfri)
    string

    The requested API version

  • (valfri)
    string

    Name of system doing the request

  • (valfri)
    string
    Medietyp i texten som skickas till API:et.
  • string
    Prenumerationsnyckel som ger åtkomst till det här API:et. Hittades i din Profil.
  • string
    OAuth 2.0-åtkomsttoken har erhållits från ids.artdatabanken.se. Beviljandetyper som stöds: Authorization code.

Brödtext i begäran

[
  "string"
]
{
  "type": "array",
  "items": {
    "type": "string"
  },
  "x-apim-inline": true
}
[
  "string"
]
{
  "type": "array",
  "items": {
    "type": "string"
  },
  "x-apim-inline": true
}
[
  "string"
]
{
  "type": "array",
  "items": {
    "type": "string"
  },
  "x-apim-inline": true
}

Svar

200 OK

Success

Återgivningar

{
  "type": "object",
  "properties": {
    "continent": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer",
          "description": "Id of item",
          "format": "int32"
        },
        "value": {
          "type": "string",
          "description": "The value.",
          "nullable": true
        }
      },
      "additionalProperties": false,
      "description": "Id value dto"
    },
    "coordinatePrecision": {
      "type": "number",
      "description": "A decimal representation of the precision of the coordinates\r\ngiven in the DecimalLatitude and DecimalLongitude.",
      "format": "double",
      "nullable": true
    },
    "coordinateUncertaintyInMeters": {
      "type": "integer",
      "description": "The horizontal distance (in meters) from the given\r\nCoordinateX and CoordinateY describing the\r\nsmallest circle containing the whole of the Location.\r\nLeave the value empty if the uncertainty is unknown, cannot\r\nbe estimated, or is not applicable (because there are\r\nno coordinates). Zero is not a valid value for this term.",
      "format": "int32",
      "nullable": true
    },
    "country": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer",
          "description": "Id of item",
          "format": "int32"
        },
        "value": {
          "type": "string",
          "description": "The value.",
          "nullable": true
        }
      },
      "additionalProperties": false,
      "description": "Id value dto"
    },
    "countryRegion": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Id of item",
          "nullable": true
        },
        "value": {
          "type": "string",
          "description": "The value.",
          "nullable": true
        }
      },
      "additionalProperties": false,
      "description": "Id value dto"
    },
    "countryCode": {
      "type": "string",
      "description": "The standard code for the country in which the\r\nLocation occurs.\r\nRecommended best practice is to use ISO 3166-1-alpha-2\r\ncountry codes.",
      "nullable": true
    },
    "county": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Id of item",
          "nullable": true
        },
        "value": {
          "type": "string",
          "description": "The value.",
          "nullable": true
        }
      },
      "additionalProperties": false,
      "description": "Id value dto"
    },
    "municipality": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Id of item",
          "nullable": true
        },
        "value": {
          "type": "string",
          "description": "The value.",
          "nullable": true
        }
      },
      "additionalProperties": false,
      "description": "Id value dto"
    },
    "parish": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Id of item",
          "nullable": true
        },
        "value": {
          "type": "string",
          "description": "The value.",
          "nullable": true
        }
      },
      "additionalProperties": false,
      "description": "Id value dto"
    },
    "province": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Id of item",
          "nullable": true
        },
        "value": {
          "type": "string",
          "description": "The value.",
          "nullable": true
        }
      },
      "additionalProperties": false,
      "description": "Id value dto"
    },
    "decimalLatitude": {
      "type": "number",
      "description": "The geographic latitude (in decimal degrees, using\r\nthe spatial reference system given in geodeticDatum)\r\nof the geographic center of a Location. Positive values\r\nare north of the Equator, negative values are south of it.\r\nLegal values lie between -90 and 90, inclusive.",
      "format": "double",
      "nullable": true
    },
    "decimalLongitude": {
      "type": "number",
      "description": "The geographic longitude (in decimal degrees, using\r\nthe spatial reference system given in geodeticDatum)\r\nof the geographic center of a Location. Positive\r\nvalues are east of the Greenwich Meridian, negative\r\nvalues are west of it. Legal values lie between -180\r\nand 180, inclusive.",
      "format": "double",
      "nullable": true
    },
    "externalId": {
      "type": "string",
      "description": "External Id of site",
      "nullable": true
    },
    "locality": {
      "type": "string",
      "description": "The specific description of the place. Less specific\r\ngeographic information can be provided in other\r\ngeographic terms (higherGeography, continent, country,\r\nstateProvince, county, municipality, waterBody, island,\r\nislandGroup). This term may contain information modified\r\nfrom the original to correct perceived errors or\r\nstandardize the description.",
      "nullable": true
    },
    "locationAccordingTo": {
      "type": "string",
      "description": "Information about the source of this Location information.\r\nCould be a publication (gazetteer), institution,\r\nor team of individuals.",
      "nullable": true
    },
    "locationId": {
      "type": "string",
      "description": "An identifier for the set of location information\r\n(data associated with dcterms:Location).\r\nMay be a global unique identifier or an identifier\r\nspecific to the data set.",
      "nullable": true
    },
    "locationRemarks": {
      "type": "string",
      "description": "Comments or notes about the Location.",
      "nullable": true
    },
    "point": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "nullable": true,
          "readOnly": true
        },
        "coordinates": {
          "type": "object",
          "properties": {
            "latitude": {
              "type": "number",
              "format": "double"
            },
            "longitude": {
              "type": "number",
              "format": "double"
            },
            "z": {
              "type": "number",
              "format": "double",
              "nullable": true
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },
    "pointWithBuffer": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "nullable": true,
          "readOnly": true
        },
        "coordinates": {
          "type": "array",
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "latitude": {
                  "type": "number",
                  "format": "double"
                },
                "longitude": {
                  "type": "number",
                  "format": "double"
                },
                "z": {
                  "type": "number",
                  "format": "double",
                  "nullable": true
                }
              },
              "additionalProperties": false
            }
          },
          "nullable": true
        }
      },
      "additionalProperties": false
    },
    "pointWithDisturbanceBuffer": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "nullable": true,
          "readOnly": true
        },
        "coordinates": {
          "type": "array",
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "latitude": {
                  "type": "number",
                  "format": "double"
                },
                "longitude": {
                  "type": "number",
                  "format": "double"
                },
                "z": {
                  "type": "number",
                  "format": "double",
                  "nullable": true
                }
              },
              "additionalProperties": false
            }
          },
          "nullable": true
        }
      },
      "additionalProperties": false
    },
    "projectId": {
      "type": "integer",
      "description": "Id of project",
      "format": "int32",
      "nullable": true
    },
    "type": {
      "enum": [
        "Unknown",
        "Point",
        "Polygon"
      ],
      "type": "string"
    }
  },
  "additionalProperties": false
}
{
  "continent": {
    "id": 0,
    "value": "string"
  },
  "coordinatePrecision": 0.0,
  "coordinateUncertaintyInMeters": 0,
  "country": {
    "id": 0,
    "value": "string"
  },
  "countryRegion": {
    "id": "string",
    "value": "string"
  },
  "countryCode": "string",
  "county": {
    "id": "string",
    "value": "string"
  },
  "municipality": {
    "id": "string",
    "value": "string"
  },
  "parish": {
    "id": "string",
    "value": "string"
  },
  "province": {
    "id": "string",
    "value": "string"
  },
  "decimalLatitude": 0.0,
  "decimalLongitude": 0.0,
  "externalId": "string",
  "locality": "string",
  "locationAccordingTo": "string",
  "locationId": "string",
  "locationRemarks": "string",
  "point": {
    "type": "string",
    "coordinates": {
      "latitude": 0.0,
      "longitude": 0.0,
      "z": 0.0
    }
  },
  "pointWithBuffer": {
    "type": "string",
    "coordinates": [
      [
        {
          "latitude": 0.0,
          "longitude": 0.0,
          "z": 0.0
        }
      ]
    ]
  },
  "pointWithDisturbanceBuffer": {
    "type": "string",
    "coordinates": [
      [
        {
          "latitude": 0.0,
          "longitude": 0.0,
          "z": 0.0
        }
      ]
    ]
  },
  "projectId": 0,
  "type": "Unknown"
}
{
  "type": "object",
  "properties": {
    "continent": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer",
          "description": "Id of item",
          "format": "int32"
        },
        "value": {
          "type": "string",
          "description": "The value.",
          "nullable": true
        }
      },
      "additionalProperties": false,
      "description": "Id value dto"
    },
    "coordinatePrecision": {
      "type": "number",
      "description": "A decimal representation of the precision of the coordinates\r\ngiven in the DecimalLatitude and DecimalLongitude.",
      "format": "double",
      "nullable": true
    },
    "coordinateUncertaintyInMeters": {
      "type": "integer",
      "description": "The horizontal distance (in meters) from the given\r\nCoordinateX and CoordinateY describing the\r\nsmallest circle containing the whole of the Location.\r\nLeave the value empty if the uncertainty is unknown, cannot\r\nbe estimated, or is not applicable (because there are\r\nno coordinates). Zero is not a valid value for this term.",
      "format": "int32",
      "nullable": true
    },
    "country": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer",
          "description": "Id of item",
          "format": "int32"
        },
        "value": {
          "type": "string",
          "description": "The value.",
          "nullable": true
        }
      },
      "additionalProperties": false,
      "description": "Id value dto"
    },
    "countryRegion": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Id of item",
          "nullable": true
        },
        "value": {
          "type": "string",
          "description": "The value.",
          "nullable": true
        }
      },
      "additionalProperties": false,
      "description": "Id value dto"
    },
    "countryCode": {
      "type": "string",
      "description": "The standard code for the country in which the\r\nLocation occurs.\r\nRecommended best practice is to use ISO 3166-1-alpha-2\r\ncountry codes.",
      "nullable": true
    },
    "county": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Id of item",
          "nullable": true
        },
        "value": {
          "type": "string",
          "description": "The value.",
          "nullable": true
        }
      },
      "additionalProperties": false,
      "description": "Id value dto"
    },
    "municipality": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Id of item",
          "nullable": true
        },
        "value": {
          "type": "string",
          "description": "The value.",
          "nullable": true
        }
      },
      "additionalProperties": false,
      "description": "Id value dto"
    },
    "parish": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Id of item",
          "nullable": true
        },
        "value": {
          "type": "string",
          "description": "The value.",
          "nullable": true
        }
      },
      "additionalProperties": false,
      "description": "Id value dto"
    },
    "province": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Id of item",
          "nullable": true
        },
        "value": {
          "type": "string",
          "description": "The value.",
          "nullable": true
        }
      },
      "additionalProperties": false,
      "description": "Id value dto"
    },
    "decimalLatitude": {
      "type": "number",
      "description": "The geographic latitude (in decimal degrees, using\r\nthe spatial reference system given in geodeticDatum)\r\nof the geographic center of a Location. Positive values\r\nare north of the Equator, negative values are south of it.\r\nLegal values lie between -90 and 90, inclusive.",
      "format": "double",
      "nullable": true
    },
    "decimalLongitude": {
      "type": "number",
      "description": "The geographic longitude (in decimal degrees, using\r\nthe spatial reference system given in geodeticDatum)\r\nof the geographic center of a Location. Positive\r\nvalues are east of the Greenwich Meridian, negative\r\nvalues are west of it. Legal values lie between -180\r\nand 180, inclusive.",
      "format": "double",
      "nullable": true
    },
    "externalId": {
      "type": "string",
      "description": "External Id of site",
      "nullable": true
    },
    "locality": {
      "type": "string",
      "description": "The specific description of the place. Less specific\r\ngeographic information can be provided in other\r\ngeographic terms (higherGeography, continent, country,\r\nstateProvince, county, municipality, waterBody, island,\r\nislandGroup). This term may contain information modified\r\nfrom the original to correct perceived errors or\r\nstandardize the description.",
      "nullable": true
    },
    "locationAccordingTo": {
      "type": "string",
      "description": "Information about the source of this Location information.\r\nCould be a publication (gazetteer), institution,\r\nor team of individuals.",
      "nullable": true
    },
    "locationId": {
      "type": "string",
      "description": "An identifier for the set of location information\r\n(data associated with dcterms:Location).\r\nMay be a global unique identifier or an identifier\r\nspecific to the data set.",
      "nullable": true
    },
    "locationRemarks": {
      "type": "string",
      "description": "Comments or notes about the Location.",
      "nullable": true
    },
    "point": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "nullable": true,
          "readOnly": true
        },
        "coordinates": {
          "type": "object",
          "properties": {
            "latitude": {
              "type": "number",
              "format": "double"
            },
            "longitude": {
              "type": "number",
              "format": "double"
            },
            "z": {
              "type": "number",
              "format": "double",
              "nullable": true
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },
    "pointWithBuffer": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "nullable": true,
          "readOnly": true
        },
        "coordinates": {
          "type": "array",
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "latitude": {
                  "type": "number",
                  "format": "double"
                },
                "longitude": {
                  "type": "number",
                  "format": "double"
                },
                "z": {
                  "type": "number",
                  "format": "double",
                  "nullable": true
                }
              },
              "additionalProperties": false
            }
          },
          "nullable": true
        }
      },
      "additionalProperties": false
    },
    "pointWithDisturbanceBuffer": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "nullable": true,
          "readOnly": true
        },
        "coordinates": {
          "type": "array",
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "latitude": {
                  "type": "number",
                  "format": "double"
                },
                "longitude": {
                  "type": "number",
                  "format": "double"
                },
                "z": {
                  "type": "number",
                  "format": "double",
                  "nullable": true
                }
              },
              "additionalProperties": false
            }
          },
          "nullable": true
        }
      },
      "additionalProperties": false
    },
    "projectId": {
      "type": "integer",
      "description": "Id of project",
      "format": "int32",
      "nullable": true
    },
    "type": {
      "enum": [
        "Unknown",
        "Point",
        "Polygon"
      ],
      "type": "string"
    }
  },
  "additionalProperties": false
}
{
  "continent": {
    "id": 0,
    "value": "string"
  },
  "coordinatePrecision": 0.0,
  "coordinateUncertaintyInMeters": 0,
  "country": {
    "id": 0,
    "value": "string"
  },
  "countryRegion": {
    "id": "string",
    "value": "string"
  },
  "countryCode": "string",
  "county": {
    "id": "string",
    "value": "string"
  },
  "municipality": {
    "id": "string",
    "value": "string"
  },
  "parish": {
    "id": "string",
    "value": "string"
  },
  "province": {
    "id": "string",
    "value": "string"
  },
  "decimalLatitude": 0.0,
  "decimalLongitude": 0.0,
  "externalId": "string",
  "locality": "string",
  "locationAccordingTo": "string",
  "locationId": "string",
  "locationRemarks": "string",
  "point": {
    "type": "string",
    "coordinates": {
      "latitude": 0.0,
      "longitude": 0.0,
      "z": 0.0
    }
  },
  "pointWithBuffer": {
    "type": "string",
    "coordinates": [
      [
        {
          "latitude": 0.0,
          "longitude": 0.0,
          "z": 0.0
        }
      ]
    ]
  },
  "pointWithDisturbanceBuffer": {
    "type": "string",
    "coordinates": [
      [
        {
          "latitude": 0.0,
          "longitude": 0.0,
          "z": 0.0
        }
      ]
    ]
  },
  "projectId": 0,
  "type": "Unknown"
}
{
  "type": "object",
  "properties": {
    "continent": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer",
          "description": "Id of item",
          "format": "int32"
        },
        "value": {
          "type": "string",
          "description": "The value.",
          "nullable": true
        }
      },
      "additionalProperties": false,
      "description": "Id value dto"
    },
    "coordinatePrecision": {
      "type": "number",
      "description": "A decimal representation of the precision of the coordinates\r\ngiven in the DecimalLatitude and DecimalLongitude.",
      "format": "double",
      "nullable": true
    },
    "coordinateUncertaintyInMeters": {
      "type": "integer",
      "description": "The horizontal distance (in meters) from the given\r\nCoordinateX and CoordinateY describing the\r\nsmallest circle containing the whole of the Location.\r\nLeave the value empty if the uncertainty is unknown, cannot\r\nbe estimated, or is not applicable (because there are\r\nno coordinates). Zero is not a valid value for this term.",
      "format": "int32",
      "nullable": true
    },
    "country": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer",
          "description": "Id of item",
          "format": "int32"
        },
        "value": {
          "type": "string",
          "description": "The value.",
          "nullable": true
        }
      },
      "additionalProperties": false,
      "description": "Id value dto"
    },
    "countryRegion": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Id of item",
          "nullable": true
        },
        "value": {
          "type": "string",
          "description": "The value.",
          "nullable": true
        }
      },
      "additionalProperties": false,
      "description": "Id value dto"
    },
    "countryCode": {
      "type": "string",
      "description": "The standard code for the country in which the\r\nLocation occurs.\r\nRecommended best practice is to use ISO 3166-1-alpha-2\r\ncountry codes.",
      "nullable": true
    },
    "county": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Id of item",
          "nullable": true
        },
        "value": {
          "type": "string",
          "description": "The value.",
          "nullable": true
        }
      },
      "additionalProperties": false,
      "description": "Id value dto"
    },
    "municipality": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Id of item",
          "nullable": true
        },
        "value": {
          "type": "string",
          "description": "The value.",
          "nullable": true
        }
      },
      "additionalProperties": false,
      "description": "Id value dto"
    },
    "parish": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Id of item",
          "nullable": true
        },
        "value": {
          "type": "string",
          "description": "The value.",
          "nullable": true
        }
      },
      "additionalProperties": false,
      "description": "Id value dto"
    },
    "province": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Id of item",
          "nullable": true
        },
        "value": {
          "type": "string",
          "description": "The value.",
          "nullable": true
        }
      },
      "additionalProperties": false,
      "description": "Id value dto"
    },
    "decimalLatitude": {
      "type": "number",
      "description": "The geographic latitude (in decimal degrees, using\r\nthe spatial reference system given in geodeticDatum)\r\nof the geographic center of a Location. Positive values\r\nare north of the Equator, negative values are south of it.\r\nLegal values lie between -90 and 90, inclusive.",
      "format": "double",
      "nullable": true
    },
    "decimalLongitude": {
      "type": "number",
      "description": "The geographic longitude (in decimal degrees, using\r\nthe spatial reference system given in geodeticDatum)\r\nof the geographic center of a Location. Positive\r\nvalues are east of the Greenwich Meridian, negative\r\nvalues are west of it. Legal values lie between -180\r\nand 180, inclusive.",
      "format": "double",
      "nullable": true
    },
    "externalId": {
      "type": "string",
      "description": "External Id of site",
      "nullable": true
    },
    "locality": {
      "type": "string",
      "description": "The specific description of the place. Less specific\r\ngeographic information can be provided in other\r\ngeographic terms (higherGeography, continent, country,\r\nstateProvince, county, municipality, waterBody, island,\r\nislandGroup). This term may contain information modified\r\nfrom the original to correct perceived errors or\r\nstandardize the description.",
      "nullable": true
    },
    "locationAccordingTo": {
      "type": "string",
      "description": "Information about the source of this Location information.\r\nCould be a publication (gazetteer), institution,\r\nor team of individuals.",
      "nullable": true
    },
    "locationId": {
      "type": "string",
      "description": "An identifier for the set of location information\r\n(data associated with dcterms:Location).\r\nMay be a global unique identifier or an identifier\r\nspecific to the data set.",
      "nullable": true
    },
    "locationRemarks": {
      "type": "string",
      "description": "Comments or notes about the Location.",
      "nullable": true
    },
    "point": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "nullable": true,
          "readOnly": true
        },
        "coordinates": {
          "type": "object",
          "properties": {
            "latitude": {
              "type": "number",
              "format": "double"
            },
            "longitude": {
              "type": "number",
              "format": "double"
            },
            "z": {
              "type": "number",
              "format": "double",
              "nullable": true
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },
    "pointWithBuffer": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "nullable": true,
          "readOnly": true
        },
        "coordinates": {
          "type": "array",
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "latitude": {
                  "type": "number",
                  "format": "double"
                },
                "longitude": {
                  "type": "number",
                  "format": "double"
                },
                "z": {
                  "type": "number",
                  "format": "double",
                  "nullable": true
                }
              },
              "additionalProperties": false
            }
          },
          "nullable": true
        }
      },
      "additionalProperties": false
    },
    "pointWithDisturbanceBuffer": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "nullable": true,
          "readOnly": true
        },
        "coordinates": {
          "type": "array",
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "latitude": {
                  "type": "number",
                  "format": "double"
                },
                "longitude": {
                  "type": "number",
                  "format": "double"
                },
                "z": {
                  "type": "number",
                  "format": "double",
                  "nullable": true
                }
              },
              "additionalProperties": false
            }
          },
          "nullable": true
        }
      },
      "additionalProperties": false
    },
    "projectId": {
      "type": "integer",
      "description": "Id of project",
      "format": "int32",
      "nullable": true
    },
    "type": {
      "enum": [
        "Unknown",
        "Point",
        "Polygon"
      ],
      "type": "string"
    }
  },
  "additionalProperties": false
}

400 Bad Request

Bad Request

Återgivningar

{
  "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

Kodexempel

@ECHO OFF

curl -v -X POST "https://api.artdatabanken.se/species-observation-system/v1/Locations"
-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-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}");

            var uri = "https://api.artdatabanken.se/species-observation-system/v1/Locations?" + 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/Locations");


            URI uri = builder.build();
            HttpPost request = new HttpPost(uri);
            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
        };
      
        $.ajax({
            url: "https://api.artdatabanken.se/species-observation-system/v1/Locations?" + $.param(params),
            beforeSend: function(xhrObj){
                // Request headers
                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/Locations";
    NSArray* array = @[
                         // Request parameters
                         @"entities=true",
                      ];
    
    NSString* string = [array componentsJoinedByString:@"&"];
    path = [path stringByAppendingFormat:@"?%@", string];

    NSLog(@"%@", path);

    NSMutableURLRequest* _request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:path]];
    [_request setHTTPMethod:@"POST"];
    // Request headers
    [_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/Locations');
$url = $request->getUrl();

$headers = array(
    // Request headers
    '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
);

$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-Api-Version': '1.5',
    'X-Requesting-System': '',
    'Content-Type': 'application/json',
    'Ocp-Apim-Subscription-Key': '{subscription key}',
    'Authorization': '{access token}',
}

params = urllib.urlencode({
})

try:
    conn = httplib.HTTPSConnection('api.artdatabanken.se')
    conn.request("POST", "/species-observation-system/v1/Locations?%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-Api-Version': '1.5',
    'X-Requesting-System': '',
    'Content-Type': 'application/json',
    'Ocp-Apim-Subscription-Key': '{subscription key}',
    'Authorization': '{access token}',
}

params = urllib.parse.urlencode({
})

try:
    conn = http.client.HTTPSConnection('api.artdatabanken.se')
    conn.request("POST", "/species-observation-system/v1/Locations?%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/Locations')


request = Net::HTTP::Post.new(uri.request_uri)
# 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