Merge branch 'feat-docs' of https://github.com/OpenSignLabs/OpenSign into feat-docs

This commit is contained in:
RaktimaNXG
2024-09-19 14:56:55 +05:30
3 changed files with 87 additions and 51 deletions
+26 -48
View File
@@ -14,6 +14,7 @@ externalDocs:
description: Find out more about OpenSign
url: http://docs.opensignlabs.com
servers:
- url: https://sandbox.opensignlabs.com/api/v1
- url: https://app.opensignlabs.com/api/v1
- url: https://staging-app.opensignlabs.com/api/v1
tags:
@@ -244,47 +245,6 @@ paths:
$ref: '#/components/schemas/invalidtoken'
security:
- x-api-token: []
/draftdocument:
post:
tags:
- Documents
summary: Draft Document
description: |
The Draft Document API enables you to create and manage document drafts. These drafts can be further enriched by adding signers and incorporating interactive widgets through our user interface at [ https://app.opensignlabs.com]( https://app.opensignlabs.com) (for cloud version). This API is designed to streamline the process of document preparation, allowing for a seamless transition from draft to final document.
### Features:
- Save Document Drafts: Securely save your documents in a draft state.
- Add Signers: Assign signers to your document directly from the API.
### Note:
You cannot add roles and widgets from this API. You will have to do it from the link received in the response.
operationId: draftedocument
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/draftdocument_body'
required: true
responses:
"200":
description: Document created successfully!
content:
application/json:
schema:
$ref: '#/components/schemas/inline_response_200_d'
"400":
description: "Something went wrong, please try again later!"
content:
application/json:
schema:
$ref: '#/components/schemas/inline_response_400_1'
"405":
description: Invalid API Token!
content:
application/json:
schema:
$ref: '#/components/schemas/invalidtoken'
security:
- x-api-token: []
/createdocument:
post:
tags:
@@ -865,7 +825,7 @@ paths:
tags:
- Webhook
summary: Save or Update Webhook
description: "The save or update Webhook API allow you to save webhook url which is used to trigger events\n### events:\n\n1. **viewed:**\n - When signer viewed document this event will trigger.\n ```\n {\n \"event\": \"viewed\",\n \"file\": \"DOCUMENT_URL\",\n \"name\": \"DOCUMENT_NAME\",\n \"note\": \"Please review and sign this document\",\n \"description\": \"\",\n \"signers\": [\n {\n \"name\": \"SIGNER_NAME\",\n \"email\": \"SIGNER_EMAIL\",\n \"phone\": \"SIGNER_PHONE\"\n }\n ],\n \"viewedBy\": \"SIGNER_EMAIL\",\n \"viewedAt\": \"TIMESTAMP\",\n \"createdAt\": \"TIMESTAMP\"\n }\n2. **created:**\n - When document is created this event will trigger.\n ```\n {\n \"event\": \"created\",\n \"file\": \"DOCUMENT_URL\",\n \"name\": \"DOCUMENT_NAME\",\n \"note\": \"Please review and sign this document\",\n \"description\": \"\",\n \"signers\": [\n {\n \"name\": \"SIGNER_NAME\",\n \"email\": \"SIGNER_EMAIL\",\n \"phone\": \"SIGNER_PHONE\"\n }\n ],\n \"createdAt\": \"TIMESTAMP\"\n }\n \n3. **signed:**\n - When document is signed by signer this event will trigger.\n ```\n {\n \"event\": \"signed\",\n \"objectId\":\"DOCUMENT_ID\"\n \"file\": \"DOCUMENT_URL\",\n \"name\": \"DOCUMENT_NAME\",\n \"note\": \"Please review and sign this document\",\n \"description\": \"\",\n \"signers\": [\n {\n \"name\": \"SIGNER_NAME\",\n \"email\": \"SIGNER_EMAIL\",\n \"phone\": \"SIGNER_PHONE\"\n },\n ]\n \"signedAt\": \"TIMESTAMP\",\n \"createdAt\": \"TIMESTAMP\"\n } \n4. **completed:**\n - When document is signed by all signers this event will trigger.\n ```\n {\n \"event\": \"completed\",\n \"file\": \"DOCUMENT_URL\",\n \"name\": \"DOCUMENT_NAME\",\n \"note\": \"Please review and sign this document\",\n \"description\": \"\",\n \"signers\": [\n {\n \"name\": \"SIGNER_NAME\",\n \"email\": \"SIGNER_EMAIL\",\n \"phone\": \"SIGNER_PHONE\"\n }\n ],\n \"completedAt\": \"TIMESTAMP\",\n \"createdAt\": \"TIMESTAMP\"\n }\n \n5. **declined:**\n - When document is declined by signer this event will trigger.\n ```\n {\n \"event\": \"declined\",\n \"file\": \"DOCUMENT_URL\",\n \"name\": \"DOCUMENT_NAME\",\n \"note\": \"Please review and sign this document\",\n \"description\": \"\",\n \"signers\": [\n {\n \"name\": \"SIGNER_NAME\",\n \"email\": \"SIGNER_EMAIL\",\n \"phone\": \"SIGNER_PHONE\"\n }\n ],\n \"declinedBy\": \"SIGNER_EMAIL\",\n \"declinedAt\": \"TIMESTAMP\",\n \"createdAt\": \"TIMESTAMP\"\n }\n"
description: "The save or update Webhook API allow you to save webhook url which is used to trigger events\n### events:\n\n1. **viewed:**\n - When signer viewed document this event will trigger.\n ```\n {\n \"event\": \"viewed\",\n \"objectId\":\"DOCUMENT_ID\"\n \"file\": \"DOCUMENT_URL\",\n \"name\": \"DOCUMENT_NAME\",\n \"note\": \"Please review and sign this document\",\n \"description\": \"\",\n \"signers\": [\n {\n \"name\": \"SIGNER_NAME\",\n \"email\": \"SIGNER_EMAIL\",\n \"phone\": \"SIGNER_PHONE\"\n }\n ],\n \"viewedBy\": \"SIGNER_EMAIL\",\n \"viewedAt\": \"TIMESTAMP\",\n \"createdAt\": \"TIMESTAMP\"\n }\n2. **created:**\n - When document is created this event will trigger.\n ```\n {\n \"event\": \"created\",\n \"objectId\":\"DOCUMENT_ID\"\n \"file\": \"DOCUMENT_URL\",\n \"name\": \"DOCUMENT_NAME\",\n \"note\": \"Please review and sign this document\",\n \"description\": \"\",\n \"signers\": [\n {\n \"name\": \"SIGNER_NAME\",\n \"email\": \"SIGNER_EMAIL\",\n \"phone\": \"SIGNER_PHONE\"\n }\n ],\n \"createdAt\": \"TIMESTAMP\"\n }\n \n3. **signed:**\n - When document is signed by signer this event will trigger.\n ```\n {\n \"event\": \"signed\",\n \"objectId\":\"DOCUMENT_ID\"\n \"file\": \"DOCUMENT_URL\",\n \"name\": \"DOCUMENT_NAME\",\n \"note\": \"Please review and sign this document\",\n \"description\": \"\",\n \"signers\": [\n {\n \"name\": \"SIGNER_NAME\",\n \"email\": \"SIGNER_EMAIL\",\n \"phone\": \"SIGNER_PHONE\"\n },\n ]\n \"signedAt\": \"TIMESTAMP\",\n \"createdAt\": \"TIMESTAMP\"\n } \n4. **completed:**\n - When document is signed by all signers this event will trigger.\n ```\n {\n \"event\": \"completed\",\n \"objectId\":\"DOCUMENT_ID\"\n \"file\": \"DOCUMENT_URL\",\n \"name\": \"DOCUMENT_NAME\",\n \"note\": \"Please review and sign this document\",\n \"description\": \"\",\n \"signers\": [\n {\n \"name\": \"SIGNER_NAME\",\n \"email\": \"SIGNER_EMAIL\",\n \"phone\": \"SIGNER_PHONE\"\n }\n ],\n \"completedAt\": \"TIMESTAMP\",\n \"createdAt\": \"TIMESTAMP\"\n }\n \n5. **declined:**\n - When document is declined by signer this event will trigger.\n ```\n {\n \"event\": \"declined\",\n \"objectId\":\"DOCUMENT_ID\"\n \"file\": \"DOCUMENT_URL\",\n \"name\": \"DOCUMENT_NAME\",\n \"note\": \"Please review and sign this document\",\n \"description\": \"\",\n \"signers\": [\n {\n \"name\": \"SIGNER_NAME\",\n \"email\": \"SIGNER_EMAIL\",\n \"phone\": \"SIGNER_PHONE\"\n }\n ],\n \"declinedBy\": \"SIGNER_EMAIL\",\n \"declinedAt\": \"TIMESTAMP\",\n \"createdAt\": \"TIMESTAMP\"\n }\n"
operationId: save&updateWebhook
requestBody:
description: Provide url to create Webhook
@@ -1199,7 +1159,7 @@ components:
$ref: '#/components/schemas/template_Signers'
sendInOrder:
type: boolean
example: false
example: true
createdAt:
$ref: '#/components/schemas/date'
updatedAt:
@@ -1339,7 +1299,7 @@ components:
$ref: '#/components/schemas/template_Signers'
sendInOrder:
type: boolean
example: false
example: true
createdAt:
$ref: '#/components/schemas/date'
updatedAt:
@@ -1462,7 +1422,10 @@ components:
$ref: '#/components/schemas/draftdocument_body_signers'
sendInOrder:
type: boolean
example: false
example: true
enableOTP:
type: boolean
example: false
createdocument_body:
required:
- file
@@ -1512,7 +1475,10 @@ components:
example: ""
sendInOrder:
type: boolean
example: false
example: true
enableOTP:
type: boolean
example: false
inline_response_200_d:
type: object
properties:
@@ -1578,12 +1544,15 @@ components:
example: ""
sendInOrder:
type: boolean
example: false
example: true
timeToCompleteDays:
type: number
description: time to complete days is used to calculate expiry date of your document
format: number
example: 15
enableOTP:
type: boolean
example: false
resendmail_body:
required:
- document_id
@@ -1645,6 +1614,9 @@ components:
folderId:
type: string
example: ""
enableOTP:
type: boolean
example: false
inline_response_200_3:
type: object
properties:
@@ -1710,7 +1682,10 @@ components:
$ref: '#/components/schemas/createtemplate_body_signers'
sendInOrder:
type: boolean
example: false
example: true
enableOTP:
type: boolean
example: false
inline_response_200_5:
type: object
properties:
@@ -1744,6 +1719,9 @@ components:
folderId:
type: string
example: ""
enableOTP:
type: boolean
example: false
inline_response_404_7:
type: object
properties:
+4 -3
View File
@@ -9,15 +9,15 @@ import ReactPlayer from 'react-player';
Command for linux/MacOS
```
export HOST_URL=https://opensign.yourdomain.com && curl --remote-name-all https://raw.githubusercontent.com/OpenSignLabs/OpenSign/docker_beta/docker-compose.yml https://raw.githubusercontent.com/OpenSignLabs/OpenSign/docker_beta/Caddyfile https://raw.githubusercontent.com/OpenSignLabs/OpenSign/docker_beta/.env.local_dev && mv .env.local_dev .env.prod && docker compose up --force-recreate
export HOST_URL=https://opensign.yourdomain.com && curl --remote-name-all https://raw.githubusercontent.com/OpenSignLabs/OpenSign/main/docker-compose.yml https://raw.githubusercontent.com/OpenSignLabs/OpenSign/main/Caddyfile https://raw.githubusercontent.com/OpenSignLabs/OpenSign/main/.env.local_dev && mv .env.local_dev .env.prod && docker compose up --force-recreate
```
Command for Windows (Powershell)
```
$env:HOST_URL="https://opensign.yourdomain.com"; Invoke-WebRequest -Uri https://raw.githubusercontent.com/OpenSignLabs/OpenSign/docker_beta/docker-compose.yml -OutFile docker-compose.yml; Invoke-WebRequest -Uri https://raw.githubusercontent.com/OpenSignLabs/OpenSign/docker_beta/Caddyfile -OutFile Caddyfile; Invoke-WebRequest -Uri https://raw.githubusercontent.com/OpenSignLabs/OpenSign/docker_beta/.env.local_dev -OutFile .env.local_dev; Rename-Item -Path .env.local_dev -NewName .env.prod; docker compose up --force-recreate
$env:HOST_URL="https://opensign.yourdomain.com"; Invoke-WebRequest -Uri https://raw.githubusercontent.com/OpenSignLabs/OpenSign/main/docker-compose.yml -OutFile docker-compose.yml; Invoke-WebRequest -Uri https://raw.githubusercontent.com/OpenSignLabs/OpenSign/main/Caddyfile -OutFile Caddyfile; Invoke-WebRequest -Uri https://raw.githubusercontent.com/OpenSignLabs/OpenSign/main/.env.local_dev -OutFile .env.local_dev; Rename-Item -Path .env.local_dev -NewName .env.prod; docker compose up --force-recreate
```
Command for Windows (CMD/Terminal)
```
set HOST_URL=https://opensign.yourdomain.com && curl -O https://raw.githubusercontent.com/OpenSignLabs/OpenSign/docker_beta/docker-compose.yml && curl -O https://raw.githubusercontent.com/OpenSignLabs/OpenSign/docker_beta/Caddyfile && curl -O https://raw.githubusercontent.com/OpenSignLabs/OpenSign/docker_beta/.env.local_dev && rename .env.local_dev .env.prod && docker compose up --force-recreate
set HOST_URL=https://opensign.yourdomain.com && curl -O https://raw.githubusercontent.com/OpenSignLabs/OpenSign/main/docker-compose.yml && curl -O https://raw.githubusercontent.com/OpenSignLabs/OpenSign/main/Caddyfile && curl -O https://raw.githubusercontent.com/OpenSignLabs/OpenSign/main/.env.local_dev && rename .env.local_dev .env.prod && docker compose up --force-recreate
```
and Hit Enter to start the containers automatically. Make sure to replace the host URL with your subdomain where OpenSign will be accessible. You need to point the subdomain to the server where you are running these commands by adding the necessary A record to your DNS.
@@ -86,6 +86,7 @@ openssl req -key ./local_dev.key -new -x509 -days 365 -out ./local_dev.crt
openssl pkcs12 -inkey ./local_dev.key -in ./local_dev.crt -export -out ./local_dev.pfx
openssl base64 -in ./local_dev.pfx -out ./base64_pfx
```
Please note that when signing a document using a certificate generated through this process, it wont be recognized as valid by Adobe Acrobat. To get the green tick on your signed documents, you'll need to purchase a document signing certificate (a p12 certificate in pfx format) from an [AATL-approved Certificate Authority](https://helpx.adobe.com/in/acrobat/kb/approved-trust-list1.html).
# CORS Configuration
@@ -0,0 +1,57 @@
---
title: OpenSign™ Self-Hosted 'Upgrade Deployment' Guide Using Docker on Linux, macOS, or Windows
---
import ReactPlayer from 'react-player';
This guide provides step-by-step instructions to upgrade the deployment of OpenSign using Docker.
### Step 1: Open the Terminal
- **Windows:** Press Win + X and select Windows PowerShell or Windows Terminal from the menu.
- **macOS:** Go to Applications > Utilities > Terminal or search for "Terminal" using Spotlight (Cmd + Space).
- **Linux:** Open the terminal from the application menu or by pressing Ctrl + Alt + T.
### Step 2: Pull the Latest Docker Images
1) Before executing the commands below, make sure Docker is running on your machine.
2) Ensure that you are in the same directory where you executed the `build` or `compose` Docker command.
Run the following command to pull the latest OpenSign Docker images:
```
docker compose pull
```
- This command will fetch the most recent versions of the Docker images required by OpenSign.
- Wait for the pulling process to complete. You should see messages indicating the progress and completion of the download.
<img width="550" alt="Pulling completed" src="https://github.com/user-attachments/assets/14525d84-d588-4d0d-bffd-f0608f3646f3" />
### Step 3: Start the Updated OpenSign Deployment
After the images have been successfully pulled, run the following command to start the updated OpenSign deployment:
```
docker compose up
```
- This command will recreate and start all the necessary containers with the updated images.
- You should see logs indicating that the containers are being created or updated, and eventually, that they are up and running.
### Running Docker Compose in Detached Mode
To start your Docker Compose services in detached mode (running in the background), use the following command:
```
docker-compose up -d
```
**Explanation:**
- docker-compose up: This command starts the services defined in your docker-compose.yml file.
- -d: The detached mode flag, which runs the containers in the background and frees up your terminal.
<img width="550" alt="Docker compose up" src="https://github.com/user-attachments/assets/791b2ac0-206a-4ed8-a1aa-164b3cf5015b" />
## Notes:
- The docker compose pull command ensures that you have the latest version of the Docker images, while the docker compose up command applies any updates and starts the containers.
## Troubleshooting:
- If you encounter any errors, check Docker logs by running docker compose logs to get more details.
- Verify that your environment variables and Docker configuration files are set correctly.
If you require more help, feel free to reach out to our customer support on support@opensignlabs.com.
For instant help and support, **[join our Discord community!](https://discord.com/invite/xe9TDuyAyj)**