Skip to content

Commit

Permalink
Add endpoint to validate using query string
Browse files Browse the repository at this point in the history
Signed-off-by: Vitor Mattos <vitor@php.rio>
  • Loading branch information
vitormattos committed Nov 23, 2023
1 parent c61a25d commit 265ebcf
Showing 1 changed file with 214 additions and 0 deletions.
214 changes: 214 additions & 0 deletions site/.vuepress/public/specs/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1257,6 +1257,220 @@ paths:
$ref: '#/components/schemas/libresignFile'
pagination:
$ref: '#/components/schemas/pagination'
'/file/validate':
get:
tags:
- sign validate
summary: Validate a file using UUID
description: Validate a file using file UUID returning file data.
operationId: File#validateUuid
parameters:
- name: uuid
in: query
description: File UUID
required: true
schema:
type: string
format: uuid
description: UUID user file identifier. The user UUID is what the person receives via email when asked to sign. This is not the file UUID.
- name: fileId
in: query
description: Node id of a Nextcloud file
required: true
schema:
type: string
description: Node id of a Nextcloud file.
example: '564'
- name: path
in: query
description: path of a Nextcloud file
required: true
schema:
type: string
description: path of a Nextcloud file.
example: /path/of/file.pdf
- name: url
in: query
description: URL of file
schema:
type: string
description: URL of file
example: 'https://github.com/LibreSign/libresign/raw/main/tests/fixtures/small_valid.pdf'
responses:
'200':
description: Success!
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/libresignFileStatus'
- type: object
properties:
name:
type: string
example: filename
file:
type: string
description: URL to download signed file
example: 'http://cloud.test.coop/apps/libresign/pdf/46d30465-ae11-484b-aad5-327249a1e8ef'
fileId:
type: integer
description: Node id of a Nextcloud file
example: 2312
uuid:
type: string
format: uuid
description: Received from sign request
request_date:
type: string
format: date-time
pattern: '\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}'
nullable: true
description: Date the file was requested to be signed
example: '2021-12-31 22:45:50'
requested_by:
$ref: '#/components/schemas/basicAccount'
pages:
type: array
description: |-
List with all pages on image format.
This property only will be returned when the query param format=image
items:
$ref: '#/components/schemas/pdfPage'
visibleElements:
description: Visible elements on document
allOf:
- $ref: '#/components/schemas/signatureElement'
- $ref: '#/components/schemas/elementCoordinate'
- type: object
properties:
signRequestId:
type: string
nullable: true
description: Representative ID of relation between file and user
example: johndoe
elementId:
type: integer
minimum: 1
example: 1
required:
- elementId
signers:
type: array
items:
type: object
properties:
signed:
type: string
pattern: '\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}'
description: 'Signing date, when signed'
example: '2021-12-31 22:45:50'
nullable: true
displayName:
type: string
description: The person display name
nullable: true
example: John
fullName:
type: string
description: The person full name
example: John Doe
nullable: true
me:
type: boolean
description: It's me?
example: true
identifyMethods:
type: array
items:
type: object
properties:
method:
type: string
example: account
description: The identify method name
value:
type: string
example: signer1
description: The value that identify the signer in the authentication method
email:
type: string
format: email
description: Unique email to identify signer. This property will only exist when it is a request made by the person who requested the document to be signed.
example: user@test.coop
uid:
type: string
description: Nextcloud user id of who requested the file to be signed.
example: johndoe
signRequestId:
type: integer
description: Relation between file and user
example: 1
required:
- signed
- fullName
- me
- signRequestId
settings:
$ref: '#/components/schemas/signSettings'
messages:
type: array
items:
type: object
properties:
type:
type: string
enum:
- success
- info
- warning
- danger
description: Type of message
message:
type: string
description: Text of message
required:
- name
- file
- status
- settings
'404':
description: Request failed
content:
application/json:
schema:
type: object
properties:
settings:
$ref: '#/components/schemas/signSettings'
action:
type: integer
description: Numeric code representing what action should be taken with the response
example: 200
errors:
type: array
items:
type: string
messages:
type: array
items:
type: object
properties:
type:
type: string
enum:
- success
- info
- warning
- danger
description: Type of message
message:
type: string
description: Text of message
required:
- settings
- errors
- action
'/file/validate/uuid/{uuid}':
get:
tags:
Expand Down

0 comments on commit 265ebcf

Please sign in to comment.