-
-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #339 from sinamics/generate_token_userapi
Generating an API Token for New Users via REST API
- Loading branch information
Showing
6 changed files
with
134 additions
and
211 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,11 +59,18 @@ paths: | |
Must be in ISO 8601 format (e.g. 2023-11-03T00:00:00.000Z). | ||
Not applicable if the user is an admin (first user). Admin accounts never expire. | ||
generateApiToken: | ||
type: boolean | ||
nullable: true | ||
description: | | ||
If set to true, the response will include an API token with a 24-hour validity period, applicable for both Personal and Organization API access. | ||
example: | ||
email: "[email protected]" | ||
password: "strong_password" | ||
name: "Ztnet User" | ||
expiresAt: "2023-11-03T00:00:00.000Z" | ||
generateApiToken: true | ||
# parameters: | ||
# - name: x-ztnet-auth | ||
# in: header | ||
|
@@ -88,39 +95,22 @@ paths: | |
type: string | ||
expiresAt: | ||
type: string | ||
apiToken: | ||
type: string | ||
example: | ||
id: "12345" | ||
email: "[email protected]" | ||
name: "Test User" | ||
id: "abcd1234" | ||
email: "[email protected]" | ||
name: "John Doe" | ||
expiresAt: "2023-10-28T00:00:00Z" | ||
apiToken: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9ihuihfds78tewgyre67dtfeswr7gyu3q8gfrv78ewrtgf8wrb98SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" | ||
|
||
401: | ||
description: Unauthorized | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
properties: | ||
error: | ||
type: string | ||
$ref: '../../_http_responses/Unauthorized.yml#/Unauthorized' | ||
429: | ||
description: Rate limit exceeded | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
properties: | ||
error: | ||
type: string | ||
$ref: '../../_http_responses/RateLimitExceeded.yml#/RateLimitExceeded' | ||
500: | ||
description: Internal server error | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
properties: | ||
message: | ||
type: string | ||
$ref: '../../_http_responses/InternalServerError.yml#/InternalServerError' | ||
|
||
components: | ||
operationId: postNewUser | ||
securitySchemes: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.