We've included generalised information in this article to help you make the best use of the Vision API.
Please note:
- All requests support only JSON format
- All responses support only JSON format
- All requests should be made using HTTPS. The API does not support HTTP.
- All endpoints are Asynchronous
- The API does not currently support client-side AJAX calls.
HTTP Response Codes
HTTP code |
Meaning |
200 OK |
The request was successful. There may be additional messages if only part of the request could be fulfilled. |
299 Deprecated |
The request was processed successfully. However, the endpoint has been deprecated and will shortly be removed. Consult the endpoint documentation for further advice. |
400 Bad Request |
One or more request parameters was invalid. The response will contain a message providing further information. |
401 Unauthorised |
The API key provided was not recognised. |
404 Not Found |
A record linked to a parameter providing a key was not found. The response will contain a message providing further information. |
410 Gone |
The endpoint has been permanently removed. Consult the endpoint documentation for further advice. |
500 Internal Server Error |
An unexpected error has occurred. Please contact us. |
Common 400 (Bad Request) messages
The following error messages returned with a 400 Bad Request response are common to most API endpoints.
Message |
Notes |
The API Key provided was either empty or null. |
The API Key was empty or null. White-space is ignored. |
No payload data was received. |
The request's model object was null. |
The <parameter name> value was empty. |
The named parameter contained an empty value (ignoring white-space). The parameter allows null values. |
The <parameter name> value was either empty or null. |
The named parameter contained an empty value (ignoring white-space), or was null. The parameter does not allow null values. |
The object was not a Location. |
The record matching the uniqueKey parameter value was not a location. Applies to methods within the Location section only. |
The object was not an Area. |
The record matching the uniqueKey value was not an area. Applies to methods within the Area section only. |
Calling an endpoint
- The API Key must be sent in the URL of the call.
- The content-type header should be set to "application/json".
- The model object (in JSON format) must be sent in the body of the request, but there is no specific order in which the parameters need to be specified.
- Examples of requests and responses use the following property values:
- "abc" indicates the value is a string,
- 1234 indicates the value is an integer,
- 0.1 indicates the value is a decimal,
- Arrays returned in a JSON response will be empty collections if they contain no data.
Example call
Endpoint: Create
URL: https://api.vision-mapping.com/data/locations/v2/create?apiKey=INSERT YOUR KEY HERE
Body:
{"layerKey":"abc","uniqueKey":"abc","name":"abc","postcode":null,"coordinates":{"latitudeY":0.1,"longitudeX":0.1},"classificationKey":"abc","relationship":[{"uniqueKey":"abc","layerKey":"abc"}],"dataFilterKeys":["abc","abc1","abc2"],"dataFields":[{"key":"abc","value":"abc"}]}
Example response
Response: 200 OK
Message:
"The request for the following Filter Key(s) could not be met: abc1, abc2"
Comments
0 comments
Article is closed for comments.