We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Would it be possible to include the API Version String in the API Endpoint (/api/), so that REST clients can validate that the version is correct?
The text was updated successfully, but these errors were encountered:
NetBox uses request headers rather than URL parameters for versioning. The API version is indicated in the API-Version response header:
API-Version
* HTTP 1.0, assume close after body < HTTP/1.0 200 OK < Date: Wed, 24 May 2017 18:25:01 GMT < Server: WSGIServer/0.1 Python/2.7.6 < Content-Length: 549 < Vary: Accept, Cookie < Allow: GET, PUT, PATCH, DELETE, OPTIONS < API-Version: 2.0 < X-Frame-Options: SAMEORIGIN < Content-Type: application/json
Requests for a version other than the current version will be rejected:
$ curl -v -H "Accept: application/json; version=1.0" http://localhost:8000/api/ * Hostname was NOT found in DNS cache * Trying 127.0.0.1... * Connected to localhost (127.0.0.1) port 8000 (#0) > GET /api/ HTTP/1.1 > User-Agent: curl/7.35.0 > Host: localhost:8000 > Accept: application/json; version=1.0 > * HTTP 1.0, assume close after body < HTTP/1.0 406 Not Acceptable < Date: Wed, 24 May 2017 18:29:53 GMT < Server: WSGIServer/0.1 Python/2.7.6 < Content-Length: 50 < Vary: Accept < Allow: GET, HEAD, OPTIONS < API-Version: 2.0 < X-Frame-Options: SAMEORIGIN < Content-Type: application/json < * Closing connection 0
Granted, this needs to be added to the API documentation.
Sorry, something went wrong.
No branches or pull requests
Would it be possible to include the API Version String in the API Endpoint (/api/), so that REST clients can validate that the version is correct?
The text was updated successfully, but these errors were encountered: