Skip to content
This repository was archived by the owner on Jun 4, 2025. It is now read-only.

Commit 265ebcf

Browse files
committed
Add endpoint to validate using query string
Signed-off-by: Vitor Mattos <vitor@php.rio>
1 parent c61a25d commit 265ebcf

File tree

1 file changed

+214
-0
lines changed

1 file changed

+214
-0
lines changed

site/.vuepress/public/specs/api.yaml

Lines changed: 214 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1257,6 +1257,220 @@ paths:
12571257
$ref: '#/components/schemas/libresignFile'
12581258
pagination:
12591259
$ref: '#/components/schemas/pagination'
1260+
'/file/validate':
1261+
get:
1262+
tags:
1263+
- sign validate
1264+
summary: Validate a file using UUID
1265+
description: Validate a file using file UUID returning file data.
1266+
operationId: File#validateUuid
1267+
parameters:
1268+
- name: uuid
1269+
in: query
1270+
description: File UUID
1271+
required: true
1272+
schema:
1273+
type: string
1274+
format: uuid
1275+
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.
1276+
- name: fileId
1277+
in: query
1278+
description: Node id of a Nextcloud file
1279+
required: true
1280+
schema:
1281+
type: string
1282+
description: Node id of a Nextcloud file.
1283+
example: '564'
1284+
- name: path
1285+
in: query
1286+
description: path of a Nextcloud file
1287+
required: true
1288+
schema:
1289+
type: string
1290+
description: path of a Nextcloud file.
1291+
example: /path/of/file.pdf
1292+
- name: url
1293+
in: query
1294+
description: URL of file
1295+
schema:
1296+
type: string
1297+
description: URL of file
1298+
example: 'https://github.com/LibreSign/libresign/raw/main/tests/fixtures/small_valid.pdf'
1299+
responses:
1300+
'200':
1301+
description: Success!
1302+
content:
1303+
application/json:
1304+
schema:
1305+
allOf:
1306+
- $ref: '#/components/schemas/libresignFileStatus'
1307+
- type: object
1308+
properties:
1309+
name:
1310+
type: string
1311+
example: filename
1312+
file:
1313+
type: string
1314+
description: URL to download signed file
1315+
example: 'http://cloud.test.coop/apps/libresign/pdf/46d30465-ae11-484b-aad5-327249a1e8ef'
1316+
fileId:
1317+
type: integer
1318+
description: Node id of a Nextcloud file
1319+
example: 2312
1320+
uuid:
1321+
type: string
1322+
format: uuid
1323+
description: Received from sign request
1324+
request_date:
1325+
type: string
1326+
format: date-time
1327+
pattern: '\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}'
1328+
nullable: true
1329+
description: Date the file was requested to be signed
1330+
example: '2021-12-31 22:45:50'
1331+
requested_by:
1332+
$ref: '#/components/schemas/basicAccount'
1333+
pages:
1334+
type: array
1335+
description: |-
1336+
List with all pages on image format.
1337+
This property only will be returned when the query param format=image
1338+
items:
1339+
$ref: '#/components/schemas/pdfPage'
1340+
visibleElements:
1341+
description: Visible elements on document
1342+
allOf:
1343+
- $ref: '#/components/schemas/signatureElement'
1344+
- $ref: '#/components/schemas/elementCoordinate'
1345+
- type: object
1346+
properties:
1347+
signRequestId:
1348+
type: string
1349+
nullable: true
1350+
description: Representative ID of relation between file and user
1351+
example: johndoe
1352+
elementId:
1353+
type: integer
1354+
minimum: 1
1355+
example: 1
1356+
required:
1357+
- elementId
1358+
signers:
1359+
type: array
1360+
items:
1361+
type: object
1362+
properties:
1363+
signed:
1364+
type: string
1365+
pattern: '\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}'
1366+
description: 'Signing date, when signed'
1367+
example: '2021-12-31 22:45:50'
1368+
nullable: true
1369+
displayName:
1370+
type: string
1371+
description: The person display name
1372+
nullable: true
1373+
example: John
1374+
fullName:
1375+
type: string
1376+
description: The person full name
1377+
example: John Doe
1378+
nullable: true
1379+
me:
1380+
type: boolean
1381+
description: It's me?
1382+
example: true
1383+
identifyMethods:
1384+
type: array
1385+
items:
1386+
type: object
1387+
properties:
1388+
method:
1389+
type: string
1390+
example: account
1391+
description: The identify method name
1392+
value:
1393+
type: string
1394+
example: signer1
1395+
description: The value that identify the signer in the authentication method
1396+
email:
1397+
type: string
1398+
format: email
1399+
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.
1400+
example: user@test.coop
1401+
uid:
1402+
type: string
1403+
description: Nextcloud user id of who requested the file to be signed.
1404+
example: johndoe
1405+
signRequestId:
1406+
type: integer
1407+
description: Relation between file and user
1408+
example: 1
1409+
required:
1410+
- signed
1411+
- fullName
1412+
- me
1413+
- signRequestId
1414+
settings:
1415+
$ref: '#/components/schemas/signSettings'
1416+
messages:
1417+
type: array
1418+
items:
1419+
type: object
1420+
properties:
1421+
type:
1422+
type: string
1423+
enum:
1424+
- success
1425+
- info
1426+
- warning
1427+
- danger
1428+
description: Type of message
1429+
message:
1430+
type: string
1431+
description: Text of message
1432+
required:
1433+
- name
1434+
- file
1435+
- status
1436+
- settings
1437+
'404':
1438+
description: Request failed
1439+
content:
1440+
application/json:
1441+
schema:
1442+
type: object
1443+
properties:
1444+
settings:
1445+
$ref: '#/components/schemas/signSettings'
1446+
action:
1447+
type: integer
1448+
description: Numeric code representing what action should be taken with the response
1449+
example: 200
1450+
errors:
1451+
type: array
1452+
items:
1453+
type: string
1454+
messages:
1455+
type: array
1456+
items:
1457+
type: object
1458+
properties:
1459+
type:
1460+
type: string
1461+
enum:
1462+
- success
1463+
- info
1464+
- warning
1465+
- danger
1466+
description: Type of message
1467+
message:
1468+
type: string
1469+
description: Text of message
1470+
required:
1471+
- settings
1472+
- errors
1473+
- action
12601474
'/file/validate/uuid/{uuid}':
12611475
get:
12621476
tags:

0 commit comments

Comments
 (0)