Raw Data
Information:
The Raw Data format contains information for both sightings and detections. With the ObjectIDs being provided being unique for sightings and non-unique for Detections.
|
API
Data Dictionary
|
List All Raw Data
Returns a list of RawData objects sorted by Sighting date in descending order
|
GET /webapi/v1/RawData
Request Example using cURL:
$ curl http://api.fish.wa.gov.au/webapi/v1/RawData
Response Example:
HTTP/1.1 200 OK
Content Type: application/json;charset=UTF 8
[
{
"RawDataId": 18605,
"ObjectId": "768",
"Distance": null,
"DistanceUnit": null,
"InteractionValue": "Detected",
"InteractionId": "4",
"TownProximity": null,
"LocationValue": "Garden Island (north end)",
"SightingNumbervalue": null,
"ReportDateTime": null,
"SightingDateTime": "2016-07-09T21:21:00",
"SightingSizeValue": null,
"SightingSpeciesValue": "bronze whaler",
"OwnerValue": "Fisheries advise",
"LocationDetail": null,
"LocationX": 115.6428,
"LocationY": -32.1441
},
{
"RawDataId": 18606,
"ObjectId": "1017",
"Distance": null,
"DistanceUnit": null,
"InteractionValue": "Detected",
"InteractionId": "4",
"TownProximity": null,
"LocationValue": "Strickland Bay (Rottnest)",
"SightingNumbervalue": null,
"ReportDateTime": null,
"SightingDateTime": "2016-07-09T21:08:00",
"SightingSizeValue": null,
"SightingSpeciesValue": "bronze whaler",
"OwnerValue": "Fisheries advise",
"LocationDetail": null,
"LocationX": 115.4765,
"LocationY": -32.0231
},
....
....
]
|
optional parameters
pageNumber (default null) a value which determins which page to retrieve.
pageSize (default 10) when a page number is set is used to determine the number of records to return each page.
sortOrder (default desc) a string which will order the results based on SightingDateTime in either ascending (asc) or descending (desc).
When paging, the results return a page object which contains metadata with details of the result set and links to the next and previous page if available. |
GET /webapi/v1/RawData?pageNumber={pageNumber}&pageSize=10&sortOrder=desc
Example Request
$cURL http://api.fish.wa.gov.au/webapi/v1/RawData?pageNumber=1&pageSize=2
Example Response
HTTP/1.1 200 OK
Content Type: application/json;charset=UTF 8
{
"MetaData": {
"TotalItems": 4982,
"CurrentPage": 1,
"TotalPages": 2228,
"NextPageLink": "http://api.fish.gov.au/webapi/v1/RawData?pageNumber=2&pageSize=2&sortOrder=desc",
"PrevPageLink": null
},
"PagedItems": [
{
"RawDataId": 18605,
"ObjectId": "768",
"Distance": null,
"DistanceUnit": null,
"InteractionValue": "Detected",
"InteractionId": "4",
"TownProximity": null,
"LocationValue": "Garden Island (north end)",
"SightingNumbervalue": null,
"ReportDateTime": null,
"SightingDateTime": "2016-07-09T21:21:00",
"SightingSizeValue": null,
"SightingSpeciesValue": "bronze whaler",
"OwnerValue": "Fisheries advise",
"LocationDetail": null,
"LocationX": 115.6428,
"LocationY": -32.1441
},
{
"RawDataId": 18606,
"ObjectId": "1017",
"Distance": null,
"DistanceUnit": null,
"InteractionValue": "Detected",
"InteractionId": "4",
"TownProximity": null,
"LocationValue": "Strickland Bay (Rottnest)",
"SightingNumbervalue": null,
"ReportDateTime": null,
"SightingDateTime": "2016-07-09T21:08:00",
"SightingSizeValue": null,
"SightingSpeciesValue": "bronze whaler",
"OwnerValue": "Fisheries advise",
"LocationDetail": null,
"LocationX": 115.4765,
"LocationY": -32.0231
}
]
} |
ERRORS
Attempting to access a page outside of the range based on page size will return an Error. Currently the error number, link will remain empty. |
Example Error Response
HTTP/1.1 400 Bad Request
{
"DeveloperMessage": "The maximum page number that can be provided is 1968 you have provided 2500 this will be treated as an error",
"ClientMessage": "Unfortunately something went wrong with the paging of the request please contact your application support team.",
"StackTrace": null,
"ErrorNumber": "0",
"ErrorLink": null
} |
Get a Single Item of RawData
Retreives a single Item from the RawData based on the rawDataID |
GET /webapi/v1/RawData/{rawDataID}
Example Request
$cURL http://api.fish.wa.gov.au/webapi/v1/RawData/18606/
Example Response
HTTP/1.1 200 OK
Content Type: application/json;charset=UTF 8
{
"RawDataId": 18606,
"ObjectId": "1017",
"Distance": null,
"DistanceUnit": null,
"InteractionValue": "Detected",
"InteractionId": "4",
"TownProximity": null,
"LocationValue": "Strickland Bay (Rottnest)",
"SightingNumbervalue": null,
"ReportDateTime": null,
"SightingDateTime": "2016-07-09T21:08:00",
"SightingSizeValue": null,
"SightingSpeciesValue": "bronze whaler",
"OwnerValue": "Fisheries advise",
"LocationDetail": null,
"LocationX": 115.4765,
"LocationY": -32.0231
} |
ERRORS
Attempting to access an item outside of the available rawDataIds will result in an error message.
|
Example Error Response
HTTP/1.1 404 Bad Request
{
"DeveloperMessage": "No such ID found in RawSighting Table",
"ClientMessage": "Unfortunately the item you are looking for is no longer available.",
"StackTrace": null,
"ErrorNumber": "0",
"ErrorLink": null
} |
List RawData based on Lat/Long
This searches Raw data based on a latitude and longitude with a default range of 10000m, this is the radius.
The Fields
Latitude & Longitude These fields provide the centre point for searching from.
SearchStyle This field defaults to InRadius, however can be changed to Nearest, InRadius will return a list of objects while Nearest will return the first item that is nearest as the crow flies.
PageNumber this is by default null to return the complete dataset.
|
GET /webapi/v1/RawData?latitude={latitude}&longitude={longitude}&rangeInM=10000&searchStyle=InRadius&pageNumber={pageNumber}&pageSize=10&sortOrder=desc
Example Request
$cURL http://api.fish.wa.gov.au/webapi/v1/RawData/?latitude=-31.646&longitude=115.7444&searchStyle=InRadius
Example Response
HTTP/1.1 200 OK
Content Type: application/json;charset=UTF 8
[
{
"RawDataId": 18180,
"ObjectId": "WA96274TSE",
"Distance": null,
"DistanceUnit": null,
"InteractionValue": "sighted",
"InteractionId": "1",
"TownProximity": "Perth Metro",
"LocationValue": "Quinns Beach",
"SightingNumbervalue": null,
"ReportDateTime": null,
"SightingDateTime": "2016-03-24T12:28:00",
"SightingSizeValue": "3m",
"SightingSpeciesValue": "unknown sp.",
"OwnerValue": "Public report",
"LocationDetail": null,
"LocationX": 115.6903,
"LocationY": -31.6722
},
{
"RawDataId": 18146,
"ObjectId": "WA54834TSE",
"Distance": "50",
"DistanceUnit": "m offshore",
"InteractionValue": "sighted",
"InteractionId": "1",
"TownProximity": "Perth Metro",
"LocationValue": "Quinns Beach",
"SightingNumbervalue": "1",
"ReportDateTime": "2015-12-27T13:36:00",
"SightingDateTime": "2015-12-27T13:10:00",
"SightingSizeValue": "2m",
"SightingSpeciesValue": "unknown sp.",
"OwnerValue": "Public report",
"LocationDetail": null,
"LocationX": 115.6903,
"LocationY": -31.6744
},
....
....
] |