Improve API docs

This commit is contained in:
David Bomba 2024-03-09 17:57:16 +11:00
parent f9a7c582b7
commit 2777a053df
4 changed files with 6579 additions and 6531 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,27 +1,32 @@
CompanyUser: CompanyUser:
properties: properties:
permissions: permissions:
description: 'The company user permissions' description: 'The user permissionsfor this company in a comma separated list'
type: string type: string
example: '[create_invoice]' example: 'create_invoice,create_client,view_client'
settings: settings:
description: 'Settings that are used for the frontend applications to store user preferences / metadata' description: 'Settings that are used for the flutter applications to store user preferences / metadata'
type: object type: object
readOnly: true
react_settings: react_settings:
description: 'Dedicated settings object for the react web application' description: 'Dedicated settings object for the react web application'
type: object type: object
readOnly: true
is_owner: is_owner:
description: 'Determines whether the user owns this company' description: 'Determines whether the user owns this company'
type: boolean type: boolean
example: true example: true
readOnly: true
is_admin: is_admin:
description: 'Determines whether the user is the admin of this company' description: 'Determines whether the user is the admin of this company'
type: boolean type: boolean
example: true example: true
readOnly: true
is_locked: is_locked:
description: 'Determines whether the users access to this company has been locked' description: 'Determines whether the users access to this company has been locked'
type: boolean type: boolean
example: true example: true
readOnly: true
updated_at: updated_at:
description: 'The last time the record was modified, format Unix Timestamp' description: 'The last time the record was modified, format Unix Timestamp'
type: integer type: integer

View File

@ -1,6 +1,6 @@
openapi: 3.0.0 openapi: 3.0.0
info: info:
title: 'Invoice Ninja API Reference - Where self host invoicing lives.' title: 'Invoice Ninja API Reference.'
description: | description: |
--- ---
<br> <br>
@ -15,7 +15,7 @@ info:
license: license:
name: 'Elastic License' name: 'Elastic License'
url: 'https://www.elastic.co/licensing/elastic-license' url: 'https://www.elastic.co/licensing/elastic-license'
version: 5.5.70 version: 5.8.34
servers: servers:
- -
url: 'https://demo.invoiceninja.com' url: 'https://demo.invoiceninja.com'

View File

@ -89,7 +89,14 @@ paths:
tags: tags:
- login - login
summary: "Attempts authentication" summary: "Attempts authentication"
description: "Returns a CompanyUser object on success" description: |
After authenticating with the API, the returned object is a CompanyUser object which is a bridge linking the user to the company.
The company user object itself contains the users permissions (admin/owner or fine grained permissions) You will most likely want to
also include in the response of this object both the company and the user object, this can be done by using the include parameter.
/api/v1/login?include=company,user
operationId: postLogin operationId: postLogin
parameters: parameters:
- $ref: "#/components/parameters/X-API-SECRET" - $ref: "#/components/parameters/X-API-SECRET"
@ -109,10 +116,17 @@ paths:
description: "The users email address." description: "The users email address."
type: string type: string
example: "demo@invoiceninja.com" example: "demo@invoiceninja.com"
required: true
password: password:
description: "The user password. Must meet minimum criteria ~ > 6 characters" description: "The user password. Must meet minimum criteria ~ > 6 characters"
type: string type: string
example: "Password0" example: "Password0"
required: true
one_time_password:
description: "The one time password if 2FA is enabled"
type: string
example: "123456"
required: false
type: object type: object
responses: responses:
200: 200:
@ -127,13 +141,15 @@ paths:
content: content:
application/json: application/json:
schema: schema:
$ref: "#/components/schemas/Client" $ref: "#/components/schemas/CompanyUser"
401: 401:
$ref: "#/components/responses/401" $ref: "#/components/responses/401"
403: 403:
$ref: "#/components/responses/403" $ref: "#/components/responses/403"
422: 422:
$ref: "#/components/responses/422" $ref: "#/components/responses/422"
429:
$ref: "#/components/responses/429"
5XX: 5XX:
description: 'Server error' description: 'Server error'
default: default: