Feedback API - Beta
Introduction
When using the Naurt final destination API you might find that locations or addresses could be improved. The feedback API allows you to suggest changes to Naurt addresses, parking locations, or door locations via a simple API. In addition, this API can be used to provide addresses Naurt does not yet have parking spot and building entrance data for. All data will be quality assessed and verified before becoming live data in the final-destination API.
Endpoint
All feedback requests should be sent to Naurt's final-destination-feedback endpoint.
https://api.naurt.net/final-destination-feedback/v1
Key things to know
- A valid API key is required to call the endpoint.
- No usage will be tallied against your API key.
- Address strings will not be matched with current data. To update an existing address please use the relevant Naurt ID.
Request
Feedback can be submitted via a POST
request to the final-destination feedback endpoint.
Again, data should be provided as a JSON in the body of the request and not in the url.
POST https://api.naurt.net/final-destination-feedback/v1
Content-Type: application/json
Authorization: <API_KEY_HERE>
{
"id": Optional<String>,
"address_string": Optional<String>,
"parking_latitude": Optional<float>,
"parking_longitude": Optional<float>,
"door_latitude": Optional<float>,
"door_longitude": Optional<float>
}
Parameters
Parameter | Type | Optional | Default | Description |
---|---|---|---|---|
id | string (UUID) | Yes | None | A valid Naurt ID for an address. |
address_string | string | Yes | None | An address string with correct spelling and formatting. |
parking_latitude | float | Yes | None | A valid parking latitude in WGS84 degrees. Range: -90 <= lat <= 90. |
parking_longitude | float | Yes | None | A valid parking longitude in WGS84 degrees. Range: -180 <= lon <= 180. |
door_latitude | float | Yes | None | A valid door latitude in WGS84 degrees. Range: -90 <= lat <= 90. |
door_longitude | float | Yes | None | A valid door longitude in WGS84 degrees. Range: -180 <= lon <= 180. |
Example
curl -XPOST \
-H "Content-type: application/json" \
-H "Authorization: <API_KEY_HERE>" \
-d '{"address_string": "167 Wiggly Road, Longtown, Kentucky, USA", "parking_latitude": 52.0, "parking_longitude":-0.12}' \
'https://api.naurt.net/final-destination-feedback/v1'
Response
Success
A 200
response code indicates a successful response with the format as follows.
{ "success": true }
This confirms that Naurt has received the suggested correction. This does not confirm that the suggestion will be used within Naurt's data.
Failure
A response code other than 200
indicates a failure to retrieve the requested destination.
401 Unauthorized
{"error": "Please ensure the request contains a valid API key."}
If not enough data was provided to make a correction, Naurt will respond with a 400.
400 Bad Request
{ "error": "When providing an address with no Naurt ID. Please provide an accompanying location." }
Code Examples
Below are some basic coded templates showing how to use the final-destination API from different languages.
import requests
import json
url = "https://api.naurt.net/final-destination-feedback/v1"
payload = json.dumps({
"id": "97cc25c6-7988-9491-c837-076058f867f3",
"parking_latitude": 51.52203917,
"parking_longitude": -0.11381551,
"door_latitude": 51.52196565,
"door_longitude": -0.11381619,
})
headers = {'Content-Type': 'application/json', 'Authorization':'<API_KEY_HERE>'}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
Request Examples
POST https://api.naurt.net/final-destination-feedback/v1
Content-Type: application/json
Authorization: <API_KEY_HERE>
{
"id": "97cc25c6-7988-9491-c837-076058f867f3",
"parking_latitude": 51.52203917,
"parking_longitude": -0.11381551,
"door_latitude": 51.52196565,
"door_longitude": -0.11381619,
}