From bdb8263610a60eceacf8c60877fbae948b19417d Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Wed, 5 Aug 2020 14:04:35 -0400 Subject: [PATCH] Standardize API requests --- docs/rest-api/authentication.md | 4 ++-- docs/rest-api/overview.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/rest-api/authentication.md b/docs/rest-api/authentication.md index 7dc66bf28..5d5777483 100644 --- a/docs/rest-api/authentication.md +++ b/docs/rest-api/authentication.md @@ -9,7 +9,7 @@ The NetBox REST API primarily employs token-based authentication. For convenienc An authentication token is attached to a request by setting the `Authorization` header to the string `Token` followed by a space and the user's token: ``` -$ curl -H "Authorization: Token d2f763479f703d80de0ec15254237bc651f9cdc0" \ +$ curl -H "Authorization: Token $TOKEN" \ -H "Accept: application/json; indent=4" \ http://netbox/api/dcim/sites/ { @@ -23,7 +23,7 @@ http://netbox/api/dcim/sites/ A token is not required for read-only operations which have been exempted from permissions enforcement (using the [`EXEMPT_VIEW_PERMISSIONS`](../../configuration/optional-settings/#exempt_view_permissions) configuration parameter). However, if a token _is_ required but not present in a request, the API will return a 403 (Forbidden) response: ``` -$ curl -H "Accept: application/json; indent=4" http://localhost/api/dcim/sites/ +$ curl http://netbox/api/dcim/sites/ { "detail": "Authentication credentials were not provided." } diff --git a/docs/rest-api/overview.md b/docs/rest-api/overview.md index bdf76f444..d16cd059d 100644 --- a/docs/rest-api/overview.md +++ b/docs/rest-api/overview.md @@ -474,7 +474,7 @@ To modify an object which has already been created, make a `PATCH` request to th ```no-highlight curl -s -X PATCH \ -> -H "Authorization: Token 98dbec0b912e5f3ddec7183c48e73b38fa9ca793" \ +> -H "Authorization: Token $TOKEN" \ > -H "Content-Type: application/json" \ > http://netbox/api/ipam/prefixes/18691/ \ > --data '{"status": "reserved"}' | jq '.'