api-documentation/src/common.yaml

1002 lines
31 KiB
YAML
Raw Blame History

openapi: 3.0.0
info:
title: "TyrePro-API, Common"
version: "1"
servers:
- url: "https://musterreifen.com/api"
description: "Demo server"
- url: "https://onlineservices.demo.rz2.prm-ag.de/O6J20ZebmghzkNgrdD759A/api"
description: "Development server"
paths:
/AddressStates:
get:
tags:
- "AddressStates"
parameters:
- $ref: "#/components/parameters/OffsetParameter"
- $ref: "#/components/parameters/LimitParameter"
- $ref: "#/components/parameters/SearchTermParameter"
responses:
200:
description: "successful operation"
headers:
TotalNumberOfEntries:
schema:
type: integer
description: The total number of results of this operation. Please be aware that this number could be wrong if the parameter SearchTerm is used, due to processing the SearchTerm over the acutal result array.
content:
application/json:
schema:
type: "array"
items:
$ref: "#/components/schemas/AddressState"
default:
$ref: "#/components/responses/GenericError"
security:
- SessionScheme: []
/AddressStates/{Guid}:
get:
tags:
- "AddressStates"
parameters:
- $ref: "#/components/parameters/GuidPathParameter"
responses:
200:
description: "successful operation"
content:
application/json:
schema:
$ref: "#/components/schemas/AddressState"
default:
$ref: "#/components/responses/GenericError"
security:
- SessionScheme: []
/Branches:
get:
tags:
- "Branches"
parameters:
- $ref: "#/components/parameters/OffsetParameter"
- $ref: "#/components/parameters/LimitParameter"
- $ref: "#/components/parameters/IsActiveParameter"
- $ref: "#/components/parameters/SearchTermParameter"
responses:
200:
description: "successful operation"
headers:
TotalNumberOfEntries:
schema:
type: integer
description: The total number of results of this operation. Please be aware that this number could be wrong if the parameter SearchTerm is used, due to processing the SearchTerm over the acutal result array.
content:
application/json:
schema:
type: "array"
items:
$ref: "#/components/schemas/Branch"
default:
$ref: "#/components/responses/GenericError"
security:
- SessionScheme: []
/Branches/{Guid}:
get:
tags:
- "Branches"
parameters:
- $ref: "#/components/parameters/GuidPathParameter"
responses:
200:
description: "successful operation"
content:
application/json:
schema:
$ref: "#/components/schemas/Branch"
default:
$ref: "#/components/responses/GenericError"
security:
- SessionScheme: []
/DbBlobs:
get:
tags:
- "DbBlobs"
parameters:
- $ref: "#/components/parameters/OffsetParameter"
- $ref: "#/components/parameters/LimitParameter"
- $ref: "#/components/parameters/SearchTermParameter"
- $ref: "#/components/parameters/ContentShallBeIncludedParameter"
responses:
200:
description: "successful operation"
headers:
TotalNumberOfEntries:
schema:
type: integer
description: The total number of results of this operation. Please be aware that this number could be wrong if the parameter SearchTerm is used, due to processing the SearchTerm over the acutal result array.
content:
application/json:
schema:
type: "array"
items:
$ref: "#/components/schemas/DbBlob"
401:
$ref: "#/components/responses/SessionOfTyreProUserOrHigherRequired"
default:
$ref: "#/components/responses/GenericError"
security:
- SessionScheme: []
/DbBlobs/{Guid}:
get:
tags:
- "DbBlobs"
parameters:
- $ref: "#/components/parameters/GuidPathParameter"
- $ref: "#/components/parameters/BinaryResponseParameter"
- $ref: "#/components/parameters/ContentDispositionParameter"
- $ref: "#/components/parameters/ContentShallBeIncludedParameter"
responses:
200:
description: "successful operation"
content:
application/json:
schema:
$ref: "#/components/schemas/DbBlob"
default:
$ref: "#/components/responses/GenericError"
security:
- SessionScheme: []
/DmsFiles:
get:
tags:
- "DmsFiles"
parameters:
- $ref: "#/components/parameters/OffsetParameter"
- $ref: "#/components/parameters/LimitParameter"
- $ref: "#/components/parameters/SearchTermParameter"
- $ref: "#/components/parameters/DmsFilesTableNameParameter"
- $ref: "#/components/parameters/GuidOfTableNameParameter"
- $ref: "#/components/parameters/DmsFilesTypeParameter"
- $ref: "#/components/parameters/ResponseResolutionDepthParameter"
responses:
200:
description: "successful operation"
headers:
TotalNumberOfEntries:
schema:
type: integer
description: The total number of results of this operation. Please be aware that this number could be wrong if the parameter SearchTerm is used, due to processing the SearchTerm over the acutal result array.
content:
application/json:
schema:
type: "array"
items:
$ref: "#/components/schemas/DmsFile"
401:
$ref: "#/components/responses/SessionOfOnlineUserOrHigherRequired"
default:
$ref: "#/components/responses/GenericError"
security:
- SessionScheme: []
/DmsFiles/{Guid}:
get:
tags:
- "DmsFiles"
parameters:
- $ref: "#/components/parameters/GuidPathParameter"
- $ref: "#/components/parameters/ResponseResolutionDepthParameter"
responses:
200:
description: "successful operation"
content:
application/json:
schema:
$ref: "#/components/schemas/DmsFile"
401:
$ref: "#/components/responses/SessionOfOnlineUserOrHigherRequired"
default:
$ref: "#/components/responses/GenericError"
security:
- SessionScheme: []
/DmsFiles/{Guid}/DmsFiles:
get:
tags:
- "DmsFiles"
parameters:
- $ref: "#/components/parameters/OffsetParameter"
- $ref: "#/components/parameters/LimitParameter"
- $ref: "#/components/parameters/SearchTermParameter"
- $ref: "#/components/parameters/GuidPathParameter"
- $ref: "#/components/parameters/DmsFilesTypeParameter"
- $ref: "#/components/parameters/ResponseResolutionDepthParameter"
responses:
200:
description: "successful operation"
headers:
TotalNumberOfEntries:
schema:
type: integer
description: The total number of results of this operation. Please be aware that this number could be wrong if the parameter SearchTerm is used, due to processing the SearchTerm over the acutal result array.
content:
application/json:
schema:
type: "array"
items:
$ref: "#/components/schemas/DmsFile"
401:
$ref: "#/components/responses/SessionOfOnlineUserOrHigherRequired"
default:
$ref: "#/components/responses/GenericError"
security:
- SessionScheme: []
/DmsFiles/custommethods/CountNumberOfFiles:
get:
tags:
- "DmsFiles"
description: "Counts all files."
parameters:
- $ref: "#/components/parameters/DmsFilesTableNameParameter"
- $ref: "#/components/parameters/GuidOfTableNameParameter"
- $ref: "#/components/parameters/RecursiveParamter"
- $ref: "#/components/parameters/DmsFilesTypeParameter"
responses:
200:
description: "successful operation"
content:
application/json:
schema:
type: "object"
required:
- "NumberOfFiles"
properties:
NumberOfFiles:
type: "number"
example:
NumberOfFiles: 12
401:
$ref: "#/components/responses/SessionOfOnlineUserOrHigherRequired"
default:
$ref: "#/components/responses/GenericError"
security:
- SessionScheme: []
/Employees:
get:
tags:
- "Employees"
parameters:
- $ref: "#/components/parameters/OffsetParameter"
- $ref: "#/components/parameters/LimitParameter"
- $ref: "#/components/parameters/IsActiveParameter"
- $ref: "#/components/parameters/SearchTermParameter"
- $ref: "#/components/parameters/ResponseResolutionDepthParameter"
responses:
200:
description: "successful operation"
headers:
TotalNumberOfEntries:
schema:
type: integer
description: The total number of results of this operation. Please be aware that this number could be wrong if the parameter SearchTerm is used, due to processing the SearchTerm over the acutal result array.
content:
application/json:
schema:
type: "array"
items:
$ref: "#/components/schemas/Employee"
401:
$ref: "#/components/responses/SessionOfTyreProUserOrHigherRequired"
default:
$ref: "#/components/responses/GenericError"
security:
- SessionScheme: []
/Employees/{Guid}:
get:
tags:
- "Employees"
parameters:
- $ref: "#/components/parameters/GuidPathParameter"
- $ref: "#/components/parameters/ResponseResolutionDepthParameter"
responses:
200:
description: "successful operation"
content:
application/json:
schema:
$ref: "#/components/schemas/Employee"
401:
$ref: "#/components/responses/SessionOfOnlineUserOrHigherRequired"
default:
$ref: "#/components/responses/GenericError"
security:
- SessionScheme: []
/Exceptions:
post:
tags:
- "Exceptions"
description: "This service without session is based on a fair use model. Please be professional and don't abuse or spam. It's just open to make your world as developer easier in case you want to report errors during session-creation. Whenever possible provide a session."
parameters:
- $ref: "#/components/parameters/ResponseResolutionDepthParameter"
- name: "Message"
in: "query"
required: false
schema:
type: "string"
- name: "StackTrace"
in: "query"
required: false
schema:
type: "string"
responses:
200:
description: "successful operation"
content:
application/json:
schema:
$ref: "#/components/schemas/Exception"
default:
$ref: "#/components/responses/GenericError"
/Exceptions/{Guid}:
get:
tags:
- "Exceptions"
parameters:
- $ref: "#/components/parameters/GuidPathParameter"
responses:
200:
description: "successful operation"
content:
application/json:
schema:
$ref: "#/components/schemas/Exception"
default:
$ref: "#/components/responses/GenericError"
/Sessions:
get:
tags:
- "Sessions"
parameters:
- $ref: "#/components/parameters/OffsetParameter"
- $ref: "#/components/parameters/LimitParameter"
- $ref: "#/components/parameters/SearchTermParameter"
- $ref: "#/components/parameters/ResponseResolutionDepthParameter"
responses:
200:
description: "successful operation"
headers:
TotalNumberOfEntries:
schema:
type: integer
description: The total number of results of this operation. Please be aware that this number could be wrong if the parameter SearchTerm is used, due to processing the SearchTerm over the acutal result array.
content:
application/json:
schema:
type: "array"
items:
$ref: "#/components/schemas/Session"
401:
$ref: "#/components/responses/SessionOfTyreProUserOrHigherRequired"
default:
$ref: "#/components/responses/GenericError"
security:
- SessionScheme: []
post:
tags:
- "Sessions"
parameters:
- $ref: "#/components/parameters/UserAgentParameter"
- $ref: "#/components/parameters/UsernameParameter"
- $ref: "#/components/parameters/PasswordHashValueParameter"
- $ref: "#/components/parameters/ResponseResolutionDepthParameter"
- name: "TableName"
in: "query"
required: true
schema:
type: "string"
enum:
- "OnlineServiceDomain"
- "OnlineUser"
- "TyreProUser"
- name: "GuidOfTableName"
in: "query"
required: false
description: "IsRequired = true, if no other information could be extracted for the create. This is the leading parameter."
schema:
type: "string"
default: null
- name: "Password"
in: "query"
description: "The password itself. Unhashed."
required: false
schema:
type: "string"
default: null
example: "secret!"
- name: "NumberOfSecondsTillExpiration"
in: "query"
description: "Describes the moment when the session expires."
required: false
schema:
type: "integer"
default: 300
minimum: 60
maximum: 86400
responses:
200:
description: "successful operation"
content:
application/json:
schema:
$ref: "#/components/schemas/Session"
default:
$ref: "#/components/responses/GenericError"
/Sessions/{Guid}:
get:
tags:
- "Sessions"
description: "You are always allowed to read your own session, but others only if your an TyreProUser."
parameters:
- $ref: "#/components/parameters/GuidPathParameter"
- $ref: "#/components/parameters/ResponseResolutionDepthParameter"
responses:
200:
description: "successful operation"
content:
application/json:
schema:
$ref: "#/components/schemas/Session"
default:
$ref: "#/components/responses/GenericError"
delete:
tags:
- "Sessions"
description: "You are always allowed to delete your own session, but only to delete others if your an TyreProUser."
parameters:
- $ref: "#/components/parameters/GuidPathParameter"
- $ref: "#/components/parameters/_HashValueParameter"
responses:
200:
description: "successful operation"
default:
$ref: "#/components/responses/GenericError"
/Sessions/custommethods/RequestResetPasswordEMail:
post:
tags:
- "Sessions"
description: "The user will get an email in which he/she is able to reset the password."
parameters:
- name: "TableName"
in: "query"
required: true
schema:
type: "string"
enum:
- "OnlineUser"
- "TyreProUser"
- name: "GuidOfTableName"
in: "query"
required: false
description: "IsRequired = true, if no other information could be extracted for the create. This is the leading parameter."
schema:
type: "string"
default: null
- $ref: "#/components/parameters/UserAgentParameter"
- $ref: "#/components/parameters/UsernameParameter"
responses:
200:
description: "successful operation"
default:
$ref: "#/components/responses/GenericError"
components:
schemas:
GenericError:
type: "object"
required:
- "Message"
- "Details"
properties:
Message:
type: "string"
Details:
type: "string"
example:
Message: "Ihr Anwender wurde nicht gefunden."
Details: "Progress.Lang.AppError\n Ihr Anwender wurde nicht gefunden.\nat sourcecode.line 123"
_HashValue:
type: "string"
description: "HashValue of the object which you'll need to process write-operations."
example: "f50df554352ac91635f900026860e3371a71999d"
AddressState:
type: "object"
required:
- "Guid"
- "Designation"
- "ISO2Code"
- "ISO3Code"
properties:
Guid:
type: "string"
Designation:
type: "string"
ISO2Code:
type: "string"
ISO3Code:
type: "string"
_HashValue:
$ref: "#/components/schemas/_HashValue"
example:
Guid: "ebb89e89-8d25-809e-7814-c53b686ae164"
Designation: "Deutschland"
ISO2Code: "DE"
ISO3Code: "DEU"
Branch:
type: "object"
required:
- "Guid"
- "Designation"
- "Number"
- "IsActive"
properties:
Guid:
type: "string"
Designation:
type: "string"
Number:
type: "integer"
IsActive:
type: "boolean"
Address:
$ref: "#/components/schemas/PostalAddress"
EMailAddress:
type: "string"
PhoneNumber:
type: "string"
FaxNumber:
type: "string"
Latitude:
type: "number"
Longitude:
type: "number"
_HashValue:
$ref: "#/components/schemas/_HashValue"
example:
Guid: "ebb89e89-8d25-809e-7814-c53b686ae164"
Designation: "Zentrale"
Number: 1
IsActive: true
Address: null
EMailAddress: "info@mail.org"
PhoneNumber: "+49123456789"
FaxNumber: null
Latitude: 12.34
Longitude: 12.34
DbBlob:
type: "object"
required:
- "Guid"
- "Designation"
- "Characterset"
- "ContentType"
- "SizeInBytes"
- "LastFileModificationMoment"
- "HashValue"
- "Content"
properties:
Guid:
type: "string"
Designation:
type: "string"
Characterset:
type: "string"
ContentType:
type: "string"
SizeInBytes:
type: "integer"
LastFileModificationMoment:
type: "string"
format: "date-time"
HashValue:
type: "string"
Content:
type: "string"
_HashValue:
$ref: "#/components/schemas/_HashValue"
example:
Guid: "ebb89e89-8d25-809e-7814-c53b686ae164"
Designation: "Hinweis.txt"
Characterset: "UTF-8"
ContentType: "Txt"
SizeInBytes: 123
LastFileModificationMoment: "2021-02-02T10:36:10.172"
HashValue: "ebb89e898d25809e7814c53b686ae164"
Content: "some binary content..."
DmsFile:
type: "object"
required:
- "Guid"
- "TableName"
- "GuidOfTableName"
- "ProgramIdentifier"
- "ProgramIdentifierDesignation"
- "Type"
properties:
Guid:
type: "string"
TableName:
type: "string"
enum:
- "Customer"
- "CustomerStorage"
- "CustomerVehicle"
- "Document"
- "SchedulerAppointment"
- "DmsFile"
GuidOfTableName:
type: "string"
ProgramIdentifier:
type: "string"
enum:
- "Billing"
- "Cub"
- "Direct"
- "Etirehotel"
- "GlMesstechnik"
- "GudatSolutions"
- "MacsDia"
- "OnlineServices"
- "Printout"
- "PurchaseSource"
- "SalesInterchange"
- "Somplatzki"
- "Zollhof"
ProgramIdentifierDesignation:
type: "string"
Type:
type: "string"
enum:
- "Directory"
- "File"
Designation:
type: "string"
GuidDbBlob:
type: "string"
Description:
type: "string"
_HashValue:
$ref: "#/components/schemas/_HashValue"
example:
Guid: "ebb89e89-8d25-809e-7814-c53b686ae164"
TableName: "DmsFile"
GuidOfTableName: "ebb89e89-8d25-809e-7814-c53b686ae164"
ProgramIdentifier: "Direct"
ProgramIdentifierDesignation: "Manuell hinzugefügte Dateien"
Type: "File"
GuidDbBlob: "ebb89e89-8d25-809e-7814-c53b686ae164"
Designation: null
Description: null
Employee:
type: "object"
required:
- "Guid"
- "IsActive"
- "Number"
- "Name"
- "GuidBranch"
properties:
Guid:
type: "string"
IsActive:
type: "boolean"
Number:
type: "number"
Name:
type: "string"
GuidBranch:
type: "string"
_HashValue:
$ref: "#/components/schemas/_HashValue"
example:
Guid: "ebb89e89-8d25-809e-7814-c53b686ae164"
IsActive: true
Number: 1
Name: "Max Mustermann"
GuidBranch: "ebb89e89-8d25-809e-7814-c53b686ae164"
Exception:
type: "object"
required:
- "Guid"
properties:
Guid:
type: "string"
example:
Guid: "ebb89e89-8d25-809e-7814-c53b686ae164"
PostalAddress:
type: "object"
properties:
Salutation:
type: "string"
Name1:
type: "string"
Name2:
type: "string"
Name3:
type: "string"
Street:
type: "string"
Postalcode:
type: "string"
Town:
type: "string"
Township:
type: "string"
GuidAddressState:
type: "string"
example:
Salutation: "Herr"
Name1: "Max Mustermann"
Name2: null
Name3: null
Street: "Musterstra<72>e 123"
Postalcode: "01234"
Town: "Musterhausen"
Township: "Musterviertel"
GuidAddressState: "ebb89e89-8d25-809e-7814-c53b686ae164"
Session:
type: "object"
required:
- "Guid"
- "TableName"
- "GuidOfTableName"
- "ExpirationMoment"
- "ClientDescription"
- "CreationIpAddress"
properties:
Guid:
type: "string"
TableName:
type: "string"
enum:
- "OnlineServiceDomain"
- "OnlineUser"
- "User"
GuidOfTableName:
type: "string"
ExpirationMoment:
type: "string"
format: "date-time"
ClientDescription:
type: "string"
CreationIpAddress:
type: "string"
_HashValue:
$ref: "#/components/schemas/_HashValue"
example:
Guid: "9acea90b-f0d9-2d95-7814-c53b28d87980"
TableName: "OnlineServiceDomain"
GuidOfTableName: "9acea90b-f0d9-2d95-7814-c53b28d87980"
ExpirationMoment: "2021-02-02T10:36:10.172"
ClientDescription: "Windows 10, Chrome"
CreationIpAddress: "12.34.56.78"
securitySchemes:
SessionScheme:
type: http
scheme: bearer
parameters:
_HashValueParameter:
name: "_HashValue"
in: "query"
description: "If you want to process a write operation you shall provide the hashvalue of the current view of the object you want to write to. If someone else has written something before you'll get a 412 response code."
required: true
schema:
type: "string"
default: null
example: "f50df554352ac91635f900026860e3371a71999d"
BinaryResponseParameter:
name: "BinaryResponse"
in: "query"
description: "When true the response will be delivered as binary data stream."
required: false
schema:
type: "boolean"
default: false
example: true
ContentDispositionParameter:
name: "ContentDisposition"
in: "query"
description: "How the file is deliverd. Inline is inside the same browser tab i.e.. This parameter takes only effect if parameter BinaryResponse=true."
required: false
schema:
type: "string"
enum:
- "Inline"
- "Attachment"
default: "Inline"
example: "Inline"
ContentShallBeIncludedParameter:
name: "ContentShallBeIncluded"
in: "query"
description: "When true the response contains the content."
required: false
schema:
type: "boolean"
default: false
example: true
DmsFilesTableNameParameter:
name: "TableName"
in: "query"
required: true
schema:
type: "string"
enum:
- "Customer"
- "CustomerStorage"
- "CustomerVehicle"
- "DmsFile"
- "Document"
- "SchedulerAppointment"
example: "DmsFile"
DmsFilesTypeParameter:
name: "Type"
in: "query"
description: "Filter by type."
required: false
schema:
type: "string"
enum:
- "Directory"
- "File"
example: "File"
GuidOfTableNameParameter:
name: "GuidOfTableName"
in: "query"
required: true
schema:
type: "string"
default: null
GuidPathParameter:
name: "Guid"
in: "path"
description: "The primary identifier of the entry (in the database)."
required: true
schema:
type: "string"
default: null
example: "ebb89e89-8d25-809e-7814-c53b686ae164"
IsActiveParameter:
name: "IsActive"
in: "query"
description: "Only active elements shall be returned. If null both will get returned."
required: false
schema:
type: "boolean"
default: null
example: true
LimitParameter:
name: "Limit"
in: "query"
description: "Limits the number of result entries."
required: false
schema:
type: "integer"
default: null
minimum: 1
maximum: 2147483647
example: 20
OffsetParameter:
name: "Offset"
in: "query"
description: "Skip the first number of entries."
required: false
schema:
type: "integer"
default: null
minimum: 0
maximum: 2147483647
example: 0
PasswordHashValueParameter:
name: "PasswordHashValue"
in: "query"
description: "The SHA-1-value of the password. The hash should be formatted as a hex-encoded string."
required: false
schema:
type: "string"
default: null
example: "e099b5c2aef873f5e2612da35056bd2287a3c404"
RecursiveParamter:
name: "Recursive"
in: "query"
required: true
schema:
type: "boolean"
default: null
ResponseResolutionDepthParameter:
name: "ResponseResolutionDepth"
in: "query"
description: "If your response object has a field with GuidSomething, this last object will be resolved. Instead of the field GuidSomething you'll get a json object of type Something with it's content. The depth determines how deep this operation shall be. The deeper, the slower your operation will be in general."
required: false
schema:
type: "integer"
default: 0
minimum: 0
maximum: 3
example: 1
SearchTermParameter:
name: "SearchTerm"
in: "query"
description: "Searches the entries and it's content."
required: false
schema:
type: "string"
default: null
example: "mc*onald"
UserAgentParameter:
name: "User-Agent"
in: "header"
required: true
schema:
type: "string"
default: null
UsernameParameter:
name: "Username"
in: "query"
required: false
schema:
type: "string"
default: null
responses:
SessionOfOnlineUserOrHigherRequired:
description: "You need a session of type OnlineUser or TyreProUser."
content:
application/json:
schema:
$ref: "#/components/schemas/GenericError"
SessionOfTyreProUserOrHigherRequired:
description: "You need a session of type TyreProUser."
content:
application/json:
schema:
$ref: "#/components/schemas/GenericError"
GenericError:
description: "Unexpected error like 4XX or 5XX http errors."
content:
application/json:
schema:
$ref: "#/components/schemas/GenericError"