Skip to content

Commit f5137f5

Browse files
Merge pull request #1538 from OpenSignLabs/draft_doc_api
Draft doc api
2 parents b8a039b + 42f2122 commit f5137f5

File tree

1 file changed

+111
-0
lines changed

1 file changed

+111
-0
lines changed

docs/docs/API-docs/opensign.yaml

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,40 @@ paths:
278278
$ref: '#/components/schemas/invalidtoken'
279279
security:
280280
- x-api-token: []
281+
/draftdocument:
282+
post:
283+
tags:
284+
- Documents
285+
summary: Draft Document
286+
description: "The Draft Document API allows users to generate new documents by providing data with base64 encoded file.\n\nTip: Upload your PDF document to our [**Debug UI**](https://app.opensignlabs.com/debugpdf), where you can easily add widgets, then copy coordinates, page numbers, and more in a ready-to-use JSON format. Plus, you can directly copy the document's base64 string, making it quick to send to the API.\n\n**Supported Widgets:**\n\nBelow are the common parameters that are required with all widgets:\n- **type:** Indicates the type of widget.\n- **page:** Specifies the page number on which you want to place the respective widget.\n- **x, y:** Denotes the horizontal and vertical coordinates of the starting point of the widget. You can use the debug UI to determine these values.\n- **w, h:** Represents the width and height of the widget. You can adjust these values using the debug UI.\n- **required:** Set to false if you want to make the widget optional. By default, it's true. Not applicable for signature-type widgets.\n- **name:** Provides a different name for widgets if you are providing more than one widget.\n- **color:** Specifies the color of the widget content. Available options include black, blue, red, and yellow, with black as the default selection if no color is specified. This parameter is optional and is applicable to the following widgets: email, name, job title, company, date, textbox, checkbox, radio button, and dropdown.\n- **fontsize:** Specifies the fontsize of the widget content. Available options include 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, and 28, with a default fontsize of 12 if not specified. This parameter is optional and is applicable to the following widgets: email, name, job title, company, date, textbox, checkbox, radio button, and dropdown.\n\n**List of all supported widgets:**\n\n\n1. **signature:**\n```\n{\n \"type\":\"signature\", \n \"page\":1, \n \"x\": 327, \n \"y\": 628, \n \"w\": 114, \n \"h\": 21\n}\n```\n2. **stamp:**\n```\n{\n \"type\":\"stamp\", \n \"page\":1, \n \"x\": 327, \n \"y\": 628, \n \"w\": 114, \n \"h\": 21, \n \"options\": {\n \"required\": true, \n \"name\": \"stamp\"\n }\n}\n```\n3. **initials:**\n```\n{\n \"type\":\"initials\", \n \"page\":1, \n \"x\": 327, \n \"y\": 628, \n \"w\": 114, \n \"h\": 21, \n \"options\": {\n \"required\": true, \n \"name\": \"initials\"\n }\n}\n```\n4. **email:**\n```\n{\n \"type\":\"email\", \n \"page\":1, \n \"x\": 327, \n \"y\": 628, \n \"w\": 114, \n \"h\": 21, \n \"options\": {\n \"required\": true, \n \"name\": \"email\",\n \"color\": \"black\",\n \"fontsize\": 12\n }\n}\n```\n5. **name:**\n```\n{\n \"type\":\"name\", \n \"page\":1, \n \"x\": 327, \n \"y\": 628, \n \"w\": 114, \n \"h\": 21, \n \"options\": {\n \"required\": true, \n \"name\": \"name\",\n \"color\": \"black\",\n \"fontsize\": 12\n }\n}\n```\n6. **job title:**\n```\n{\n \"type\":\"job title\", \n \"page\":1, \n \"x\": 327, \n \"y\": 628, \n \"w\": 114, \n \"h\": 21, \n \"options\": {\n \"required\": true, \n \"name\": \"job title\",\n \"color\": \"black\",\n \"fontsize\": 12\n }\n}\n```\n7. **company:**\n```\n{\n \"type\":\"company\", \n \"page\":1, \n \"x\": 327, \n \"y\": 628, \n \"w\": 114, \n \"h\": 21, \n \"options\": {\n \"required\": true, \n \"name\": \"company\",\n \"color\": \"black\",\n \"fontsize\": 12\n }\n}\n```\n8. **date:**\n```\n{\n \"type\":\"date\", \n \"page\":1, \n \"x\": 327, \n \"y\": 628, \n \"w\": 114, \n \"h\": 21, \n \"options\": {\n \"required\": true, \n \"name\": \"date\",\n \"default\": \"04-15-2024\",\n \"format\": \"mm-dd-yyyy\",\n \"color\": \"black\",\n \"fontsize\": 12\n }\n}\n ```\n- **default:** Provide the date from which you want to start the date of the date widget. Must be provided in the specified format. By default, today's date provided.\n- **format:** Specify the date format of your choice from the options below.\n - \"dd/MM/yyyy\",\n - \"dd-mm-yyyy\", \n - \"yyyy-mm-dd\", \n - \"mm.dd.yyyy\", \n - \"mm-dd-yyyy\", \n - \"mmm dd, yyyy\", \n - \"mmmm dd, yyyy\", \n - \"dd mmm, yyyy\", \n - \"dd mmmm, yyy\"\n\n9. **textbox:**\n```\n{\n \"type\":\"textbox\", \n \"page\":1, \n \"x\": 327, \n \"y\": 628, \n \"w\": 114, \n \"h\": 21, \n \"options\": { \n \"name\": \"textbox\",\n \"required\": true,\n \"readonly\": false,\n \"default\": \"name\",\n \"hint\": \"provide name\",\n \"regularexpression\":\"\",\n \"color\": \"black\",\n \"fontsize\": 12\n }\n}\n```\n- **default:** Provide a default value for the textbox (Optional).\n- **hint:** Provide a hint for the textbox (Optional).\n- **regularexpression:** Provide regex for custom validation, such as allowing only numbers, only capital letters, etc. (Optional).\n- **readonly:** Set to true if you want to set the textbox as readonly. By default, it's false.\n\n10. **checkbox:**\n```\n{\n \"type\":\"checkbox\", \n \"page\":1, \n \"x\": 327, \n \"y\": 628, \n \"w\": 114, \n \"h\": 21, \n \"options\": {\n \"required\": true, \n \"name\": \"checkbox\",\n \"values\": [\"male\", \"female\", \"other\"],\n \"selectedvalues\": [ \"male\", \"female\" ],\n \"readonly\": false, \n \"hidelabel\": false,\n \"color\": \"black\",\n \"fontsize\": 12,\n \"validation\": {\n \"minselections\": 0, \n \"maxselections\": 0 \n }\n }\n}\n```\n- **values:** Provide options for the checkbox list.\n- **selectedvalues:** Provide values that need to be selected by default (Optional).\n- **readonly:** Set to true if you want to set the checkbox as readonly. By default, it's false\n- **hidelabel:** Set to true if you want to hide labels of the checkbox. By default, it's false.\n- **minselections:** Provide the minimum number of checkboxes that must be selected by the user.\n- **maxselections:** Provide the maximum number of checkboxes that can be selected by the user.\n\n11. **dropdown:**\n ```\n{\n \"type\":\"dropdown\", \n \"page\":1, \n \"x\": 327, \n \"y\": 628, \n \"w\": 114, \n \"h\": 21, \n \"options\": {\n \"required\": true, \n \"name\": \"dropdown\",\n \"readonly\": false,\n \"values\": [\"male\", \"female\", \"other\"],\n \"default\": \"\",\n \"color\": \"black\",\n \"fontsize\": 12\n }\n}\n```\n- **values:** Provide options for the dropdown list.\n- **default:** Provide the value that needs to be selected by default. Only one value is accepted. (Optional).\n- **readonly:** Set to true if you want to set the dropdown as readonly. By default, it's false.\n12. **radio button:**\n```\n{\n \"type\":\"radio button\", \n \"page\":1, \n \"x\": 327, \n \"y\": 628, \n \"w\": 114, \n \"h\": 21, \n \"options\": {\n \"readonly\": false,\n \"required\": true, \n \"name\": \"radio button\",\n \"values\": [\"male\", \"female\", \"other\"],\n \"default\": \"male\",\n \"color\": \"black\",\n \"fontsize\": 12\n }\n}\n``` \n- **values:** Provide options for the radio button list.\n- **default:** Provide the value that needs to be selected by default. Only one value is accepted. (Optional).\n- **readonly:** Set to true if you want to set the radio button as readonly. By default, it's false.\n\n13. **image:**\n```\n{\n \"type\":\"image\", \n \"page\":1, \n \"x\": 327, \n \"y\": 628, \n \"w\": 114, \n \"h\": 21, \n \"options\": {\n \"required\": true, \n \"name\": \"image\"\n }\n}\n```\n"
287+
operationId: draftdocument
288+
requestBody:
289+
content:
290+
application/json:
291+
schema:
292+
$ref: '#/components/schemas/draftdocument_body'
293+
required: true
294+
responses:
295+
"200":
296+
description: Document created successfully!
297+
content:
298+
application/json:
299+
schema:
300+
$ref: '#/components/schemas/inline_draft_doc_res_200_1'
301+
"400":
302+
description: "Something went wrong, please try again later!"
303+
content:
304+
application/json:
305+
schema:
306+
$ref: '#/components/schemas/inline_response_400_1'
307+
"405":
308+
description: Invalid API Token!
309+
content:
310+
application/json:
311+
schema:
312+
$ref: '#/components/schemas/invalidtoken'
313+
security:
314+
- x-api-token: []
281315
/createdocument:
282316
post:
283317
tags:
@@ -1509,6 +1543,68 @@ components:
15091543
type: boolean
15101544
description: "true - this option will enable a guided tour for signers, providing instructions during the signing process. false - disable the guided tour, ensuring a faster, uninterrupted signing experience."
15111545
example: false
1546+
draftdocument_body:
1547+
required:
1548+
- file
1549+
- title
1550+
type: object
1551+
properties:
1552+
file:
1553+
type: string
1554+
format: base64
1555+
example: base64 encoded pdf
1556+
title:
1557+
type: string
1558+
format: string
1559+
example: sample document
1560+
description:
1561+
type: string
1562+
format: string
1563+
example: sample Description
1564+
note:
1565+
type: string
1566+
format: string
1567+
example: sample Note
1568+
timeToCompleteDays:
1569+
type: number
1570+
description: time to complete days is used to calculate expiry date of your document
1571+
format: number
1572+
example: 15
1573+
signers:
1574+
type: array
1575+
items:
1576+
$ref: '#/components/schemas/createdocument_body_signers'
1577+
folderId:
1578+
type: string
1579+
example: ""
1580+
send_email:
1581+
type: boolean
1582+
description: "This parameter allows you to specify whether you want emails to be sent to signers. The default value is \"true\". If the value of this parameter is \"true\" and no 'email_subject'/'email_body' parameters are specified default email templates will be used. \n"
1583+
example: true
1584+
email_subject:
1585+
type: string
1586+
description: "Custom mail subject for signature request. Can include the following {{document_title}} {{sender_name}}, {{sender_mail}}, {{sender_phone}}, {{receiver_name}}, {{receiver_email}}, {{receiver_phone}}, {{expiry_date}}, {{company_name}}, {{signing_url}}."
1587+
example: ""
1588+
email_body:
1589+
type: string
1590+
description: "Custom signature request email body. Can include the following {{document_title}} {{sender_name}}, {{sender_mail}}, {{sender_phone}}, {{receiver_name}}, {{receiver_email}}, {{receiver_phone}}, {{expiry_date}}, {{company_name}}, {{signing_url}}."
1591+
example: ""
1592+
sendInOrder:
1593+
type: boolean
1594+
description: "If set to 'true', only the first signer will receive the signature request email initially. Emails to subsequent signers will be triggered sequentially, with each sent only after the previous signer has completed their signing. By default, sendInOrder is set to 'true'."
1595+
example: true
1596+
enableOTP:
1597+
type: boolean
1598+
description: "true - this option will enable OTP verification. Users will receive a verification code via email, which they must enter to sign the document. false - this option will disable OTP verification, allowing users to sign the document directly without additional steps."
1599+
example: false
1600+
enableTour:
1601+
type: boolean
1602+
description: "true - this option will enable a guided tour for signers, providing instructions during the signing process. false - disable the guided tour, ensuring a faster, uninterrupted signing experience."
1603+
example: false
1604+
email_sender_name:
1605+
type: string
1606+
description: name or email of the person or organization on the behalf of which you are sending the mail.
1607+
example: opensign
15121608
createdocument_body:
15131609
required:
15141610
- file
@@ -1568,6 +1664,10 @@ components:
15681664
type: boolean
15691665
description: "true - this option will enable a guided tour for signers, providing instructions during the signing process. false - disable the guided tour, ensuring a faster, uninterrupted signing experience."
15701666
example: false
1667+
email_sender_name:
1668+
type: string
1669+
description: name or email of the person or organization on the behalf of which you are sending the mail.
1670+
example: opensign
15711671
inline_response_200_1:
15721672
type: object
15731673
properties:
@@ -1579,6 +1679,17 @@ components:
15791679
type: string
15801680
format: string
15811681
example: https://url-to-sign-document.com
1682+
inline_draft_doc_res_200_1:
1683+
type: object
1684+
properties:
1685+
document_id:
1686+
type: string
1687+
format: string
1688+
example: hji2zxcv2P
1689+
url:
1690+
type: string
1691+
format: string
1692+
example: https://url-to-send-document.com
15821693
createdocumenttemplate_id_Signers:
15831694
type: object
15841695
properties:

0 commit comments

Comments
 (0)