From 51d1b6e0d6a6fadfa2a854f6164778916d67693d Mon Sep 17 00:00:00 2001 From: jeremystretch Date: Fri, 6 Aug 2021 08:39:57 -0400 Subject: [PATCH] Fixes #6901: Correct example REST API request --- docs/release-notes/version-3.0.md | 6 +++--- docs/rest-api/authentication.md | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/release-notes/version-3.0.md b/docs/release-notes/version-3.0.md index 105ee2143..458d8a26c 100644 --- a/docs/release-notes/version-3.0.md +++ b/docs/release-notes/version-3.0.md @@ -146,11 +146,11 @@ The new REST API endpoint `/api/users/tokens/` has been added, which includes a $ curl -X POST \ -H "Content-Type: application/json" \ -H "Accept: application/json; indent=4" \ -https://netbox/api/users/tokens/provision/ -{ +https://netbox/api/users/tokens/provision/ \ +--data '{ "username": "hankhill", "password: "I<3C3H8", -} +}' ``` If the supplied credentials are valid, NetBox will create and return a new token for the user. diff --git a/docs/rest-api/authentication.md b/docs/rest-api/authentication.md index 246896233..93c1ce303 100644 --- a/docs/rest-api/authentication.md +++ b/docs/rest-api/authentication.md @@ -39,11 +39,11 @@ To provision a token via the REST API, make a `POST` request to the `/api/users/ $ curl -X POST \ -H "Content-Type: application/json" \ -H "Accept: application/json; indent=4" \ -https://netbox/api/users/tokens/provision/ -{ +https://netbox/api/users/tokens/provision/ \ +--data '{ "username": "hankhill", "password: "I<3C3H8", -} +}' ``` Note that we are _not_ passing an existing REST API token with this request. If the supplied credentials are valid, a new REST API token will be automatically created for the user. Note that the key will be automatically generated, and write ability will be enabled.