### Install Pods Source: https://ignisign.io/docs/quick-start/signature-interface/iOS_Integration Run the 'pod install' command to install dependencies defined in your Podfile. ```bash pod install ``` -------------------------------- ### Start Development Server Source: https://ignisign.io/docs/sdks/examples/node-js Start the development server using npm. ```bash npm run dev ``` -------------------------------- ### Install Node.js SDK Source: https://ignisign.io/docs/quick-start/backend-integration/Node_JS_SDK_Integration Install the IgniSign SDK packages using npm, yarn, or pnpm. ```bash npm install @ignisign/public @ignisign/sdk ``` ```bash yarn add @ignisign/public @ignisign/sdk ``` ```bash pnpm add @ignisign/public @ignisign/sdk ``` -------------------------------- ### Install Ignisign SDK Source: https://ignisign.io/docs/sdks/node-js Install the Ignisign SDK package using npm. It is recommended to also install the public package for enhanced IDE support. ```bash npm install @ignisign/sdk ``` ```bash npm install @ignisign/public ``` -------------------------------- ### Install Ignisign JavaScript SDK Source: https://ignisign.io/docs/sdks/browser-js Install the Ignisign JavaScript library using npm. Ensure you have an Ignisign account. ```bash npm install @ignisign/ignisign-js ``` -------------------------------- ### Install Dependencies (Yarn) Source: https://ignisign.io/docs/sdks/examples/node-js Install project dependencies using yarn. ```bash yarn install ``` -------------------------------- ### Install Dependencies Source: https://ignisign.io/docs/sdks/examples/node-js Install project dependencies using npm. ```bash npm install ``` -------------------------------- ### Signer Profile Response Example Source: https://ignisign.io/docs/ignisign-api/get-signer-profile This is an example of a successful response when retrieving a signer profile. It includes details about the application, status, integration mode, and authentication configurations. ```json { "_id": "string", "appId": "appId_XXXX-XXXX-XXXX-XXXX-XXXX", "appEnv": "DEVELOPMENT", "name": "string", "description": "string", "status": "ACTIVE", "version": 0, "isEmailProofSentByIgnisign": true, "isRecurrent": true, "integrationMode": "BY_SIDE", "ssoConfigId": "string", "signatureAuthMethodsConfiguration": { "SIMPLE_STD": { "idProofings": [ "VIDEO_ROBOT_AES" ], "authMethods": [ "SIMPLE" ] }, "ADVANCED_STD": { "idProofings": [ "VIDEO_ROBOT_AES" ], "authMethods": [ "SIMPLE" ] }, "QUALIFIED_STD": { "idProofings": [ "VIDEO_ROBOT_AES" ], "authMethods": [ "SIMPLE" ] } }, "emailDomains": [ "string" ], "signerIds": [ "string" ], "accept2FADelegation": true } ``` -------------------------------- ### Install n8n Ignisign Node Package Source: https://ignisign.io/docs/quick-start/no-code-integrations Install the Ignisign node package for n8n to integrate electronic signatures into your n8n workflows. This is a prerequisite for using the Ignisign node. ```bash npm install @ignisign/n8n-nodes-ignisign ``` -------------------------------- ### Launch Application (Yarn) Source: https://ignisign.io/docs/sdks/examples/node-js Launch the application using yarn. ```bash yarn dev ``` -------------------------------- ### Initialize IgnisignSdk Class Source: https://ignisign.io/docs/sdks/node-js Instantiate the IgnisignSdk class with your application credentials. Ensure you have your appId, appEnv, and appSecret from the Ignisign Console. ```javascript import { IgnisignSdk } from "@ignisign/sdk" const ignisignSdkInstance = new IgnisignSdk({ appId: IGNISIGN_APP_ID, appEnv: (IGNISIGN_APP_ENV), appSecret: IGNISIGN_APP_SECRET, displayWarning: true, }); ``` -------------------------------- ### Unauthorized Error Response Example Source: https://ignisign.io/docs/ignisign-api/get-signer-profile This example illustrates the structure of an unauthorized error response, typically returned when authentication fails. It includes a message and a timestamp. ```json { "message": "string", "timestamp": "date-time" } ``` -------------------------------- ### Handle SDK Initialization Errors Source: https://ignisign.io/docs/quick-start/backend-integration/Node_JS_SDK_Integration Verify SDK initialization by ensuring the init() method is called after instance creation. Check API key validity and ensure necessary packages are installed. ```javascript console.error('Error initializing SDK:', error); throw error; ``` -------------------------------- ### TypeScript/JavaScript API Request Example Source: https://ignisign.io/docs/quick-start/backend-integration/REST_API_Integration Demonstrates how to set up authentication headers and make an API request using fetch in TypeScript/JavaScript. Ensure your API key is correctly formatted. ```typescript // Add your API key to request headers const headers = { 'Authorization': 'Bearer skv2_your_api_key_here', 'Content-Type': 'application/json' }; async function makeApiRequest(endpoint, method, data = null) { const response = await fetch(`https://api.ignisign.io/v4/${endpoint}`, { method, headers, ...(data && { body: JSON.stringify(data) }) }); if (!response.ok) { throw new Error(`API request failed: ${response.statusText}`); } return await response.json(); } ``` -------------------------------- ### Webhook Event Success Response Example Source: https://ignisign.io/docs/ignisign-api/get-webhook-event This example shows the structure of a successful webhook event payload. It includes details about the event's origin, topic, action, and status. ```json { "_id": "string", "appId": "appId_XXXX-XXXX-XXXX-XXXX-XXXX", "appEnv": "DEVELOPMENT", "webhookId": "string", "topic": "ALL", "action": "SETTINGS_UPDATED", "msgNature": "INFO", "content": {}, "error": {}, "response": { "status": 0, "statusText": "string" }, "status": "SUCCESS", "_createdAt": "2024-07-29T15:51:28.071Z" } ``` -------------------------------- ### Initialize Ignisign SDK with Custom Display Options Source: https://ignisign.io/docs/quick-start/signature-interface/Android_Integration Configure the Ignisign SDK with custom CSS, logo, primary color, and language settings for a tailored user experience. This is useful for branding and localization. ```kotlin val displayOptions = IgnisignDisplayOptions( customCSS = "body { background-color: #f5f5f5; }", // Custom CSS logo = "https://your-company.com/logo.png", // Custom logo primaryColor = "#007bff" // Custom primary color ) // Create initialization parameters with the custom display options val initParams = IgnisignInitParams( signatureRequestId = signatureRequestId, signerId = signerId, dimensions = dimensions, displayOptions = displayOptions, lang = "fr" // Set language to French ) ``` -------------------------------- ### Example Data Structures for Bare Signature Source: https://ignisign.io/docs/core-concepts/Bare_Signatures Defines TypeScript types for document data, signature status, and the overall bare signature object used in the IgniSign NodeJS SDK examples. ```typescript type Example_BareSignatureDocument = { fileB64: string; fileName: string; mimeType: string; documentHash: string; }; enum EXAMPLE_BARE_SIGNATURE_STATUS { INIT = 'INIT', IN_PROGRESS = 'IN_PROGRESS', SIGNED = 'SIGNED', } type Example_BareSignature = { _id?: string; title: string; document: Example_BareSignatureDocument; status: EXAMPLE_BARE_SIGNATURE_STATUS; codeVerifier: string; accessToken?: string; }; ``` -------------------------------- ### Launch Signature Activity Source: https://ignisign.io/docs/quick-start/signature-interface/Android_Integration Initiate the signature process by starting the SignatureActivity from another part of your application. Pass necessary IDs as extras to the intent. ```kotlin // In your document list activity or fragment import android.content.Intent // ... private fun startSignatureProcess(signatureRequestId: String, signerId: String) { val intent = Intent(this, SignatureActivity::class.java).apply { putExtra("signatureRequestId", signatureRequestId) putExtra("signerId", signerId) } startActivity(intent) } ``` -------------------------------- ### GET /v4/documents/:documentId/img-signatures Source: https://ignisign.io/docs/ignisign-api/get-signature-img Retrieves the image of a signature from a document. ```APIDOC ## GET /v4/documents/:documentId/img-signatures ### Description This endpoint retrieves the image of a signature from a document. ### Method GET ### Endpoint /v4/documents/:documentId/img-signatures ### Parameters #### Path Parameters - **documentId** (string) - Required - The unique identifier of the document. ``` -------------------------------- ### Initialize IgniSign SDK Source: https://ignisign.io/docs/quick-start/backend-integration/Node_JS_SDK_Integration Initialize the IgniSign SDK with your API key and display warnings. This step is required before using other SDK methods. ```typescript import { IgnisignSdk } from '@ignisign/sdk'; import { IGNISIGN_APPLICATION_ENV } from '@ignisign/public'; // Initialize the SDK const ignisignSdk = new IgnisignSdk({ apiKey: 'skv2_YOUR_API_KEY', displayWarning: true }); // Initialize the SDK (required before using other methods) async function initializeSDK(): Promise { try { await ignisignSdk.init(); console.log('IgniSign SDK initialized successfully'); } catch (error) { console.error('Failed to initialize IgniSign SDK:', error); } } initializeSDK(); ``` -------------------------------- ### Get Signer Details Source: https://ignisign.io/docs/ignisign-api/get-signer-with-details Retrieves all details for a given signer ID. ```APIDOC ## GET /signers/{signerId} ### Description Retrieves all details for a given signer ID. ### Method GET ### Endpoint /signers/{signerId} ### Parameters #### Path Parameters - **signerId** (string) - Required - Unique identifier for the signer. ### Response #### Success Response (200) - **signerId** (string) - Unique identifier for the signer. - **externalId** (string) - External identifier for the signer. - **firstName** (string) - First name of the signer. - **lastName** (string) - Last name of the signer. - **email** (string) - Email of the signer. - **status** (IGNISIGN_SIGNER_STATUS) - The status of the signer. Possible values: [`CREATED`, `PENDING`, `BLOCKED`, `ACTIVE`, `CORRUPTED`]. - **alreadyProvidedInputs** (string[]) - Possible values: [`firstName`, `lastName`, `email`, `phoneNumber`, `nationality`, `birthDate`, `birthPlace`, `birthCountry`]. - **isRecurrent** (boolean) - - **signerProfileId** (string) - - **sealClaims** (string[]) - Possible values: [`EID_POSSESSION_AES`, `PHONE_NUMBER_POSSESSION`, `PRIVATE_KEY_POSSESSION`, `DAPP_WALLET_POSSESSION`, `APP_SIGNER_SECRET_POSSESSION`, `TOTP_POSSESSION`, `EMAIL_POSSESSION`, `ID_DOC_POSSESSION_AES`, `RA_PROCESS_VALIDATED_AES`, `BANK_ACCOUNT_POSSESSION`, `NATURAL_PERSON_NAME`, `LEGAL_PERSON_NAME`, `PASS_KEY_POSSESSION`, `NATIONALITY`, `CORPORATE_SSO_ACCOUNT_POSSESSION`, `GOOGLE_ACCOUNT_POSSESSION`, `GITHUB_ACCOUNT_POSSESSION`, `BIRTH_COUNTRY`, `BIRTH_DATE`, `BIRTH_PLACE`, `CAN_APPROVE_SEAL_SES`, `CAN_APPROVE_SEAL_AES`, `EXTENDED_SESSION`]. - **fromUserId** (string) - The id of the user that have the same email as the signer and that is a user of the application or organization (into IgniSign). - **claims** (object[]) - Required - An array of claim objects. - **claimRef** (string) - A reference that determinates the claim type. Possible values: [`EID_POSSESSION_AES`, `PHONE_NUMBER_POSSESSION`, `PRIVATE_KEY_POSSESSION`, `DAPP_WALLET_POSSESSION`, `APP_SIGNER_SECRET_POSSESSION`, `TOTP_POSSESSION`, `EMAIL_POSSESSION`, `ID_DOC_POSSESSION_AES`, `RA_PROCESS_VALIDATED_AES`, `BANK_ACCOUNT_POSSESSION`, `NATURAL_PERSON_NAME`, `LEGAL_PERSON_NAME`, `PASS_KEY_POSSESSION`, `NATIONALITY`, `CORPORATE_SSO_ACCOUNT_POSSESSION`, `GOOGLE_ACCOUNT_POSSESSION`, `GITHUB_ACCOUNT_POSSESSION`, `BIRTH_COUNTRY`, `BIRTH_DATE`, `BIRTH_PLACE`, `CAN_APPROVE_SEAL_SES`, `CAN_APPROVE_SEAL_AES`, `EXTENDED_SESSION`]. #### Error Responses - **400** - Bad Request - **401** - Unauthorized - **403** - Forbidden - **404** - Not Found - **408** - Request Timeout - **500** - Internal Server Error ``` -------------------------------- ### Generate Authorization URL using IgniSign SDK Source: https://ignisign.io/docs/core-concepts/Bare_Signatures Demonstrates how to use the IgniSign SDK to generate an authorization URL and nonce for a bare signature request. Ensure the SDK and uuid are imported. ```typescript import { IgniSignSdkUtilsService, IgniSignSdk } from '@ignisign/sdk'; import * as uuid from "uuid"; const exampleBareSignature: Example_BareSignature = { title: "Example Signature", externalId: "example-signature-reference-1", status: EXAMPLE_BARE_SIGNATURE_STATUS.INIT, codeVerifier: "codeVerifier", document: { fileB64: "base64", fileName: "example.pdf", mimeType: "application/pdf", documentHash: "hash_as_sha256_base64", }, }; const codeChallenge = IgniSignSdkUtilsService.bareSignature_GenerateCodeChallenge(exampleBareSignature.codeVerifier); const urlAuthRequestDto: IgnisignBareSignature_GetAuthorizationUrlRequest = { externalId: exampleBareSignature._id, hashes: [exampleBareSignature.document.documentHash], redirectUri: "https://example.com/redirect", codeChallenge: codeChallenge, }; const { authorizationUrl, nonce } = await IgniSignSdkManagerBareSignatureService.getAuthorizationUrl(urlAuthRequestDto); // Return the authorization URL to your application frontend ``` -------------------------------- ### Get Signer Summary Source: https://ignisign.io/docs/ignisign-api/get-signer-summary Retrieves a summary of information for a specific signer. ```APIDOC ## GET /v4/applications/:appId/envs/:appEnv/signers/:signerId ### Description This endpoint retrieves a summary of information for a specific signer. ### Method GET ### Endpoint /v4/applications/:appId/envs/:appEnv/signers/:signerId ### Parameters #### Path Parameters - **appId** (string) - Required - The application identifier which is used to identify the application used. - **appEnv** (string) - Required - The execution environment of the application where request are executed. Possible values: [`DEVELOPMENT`, `STAGING`, `PRODUCTION`] - **signerId** (string) - Required - The unique identifier of the signer. ``` -------------------------------- ### Create Signature View Controller Source: https://ignisign.io/docs/quick-start/signature-interface/iOS_Integration Set up a view controller to manage the signature process, including initializing the IgniSign webview and handling callbacks. ```swift class SignatureViewController: UIViewController, IgnisignJS_SignatureSession_Callbacks { // Properties for signature request var signatureRequestId: String! var signerId: String! var signatureSessionToken: String! // Session token from your backend var signerAuthSecret: String! // Required for embedded integration // IgniSign webview var ignisignWebView: Ignisign! override func viewDidLoad() { super.viewDidLoad() // Create a WKWebViewConfiguration let webViewConfiguration = WKWebViewConfiguration() // Initialize the IgniSign webview ignisignWebView = Ignisign(frame: view.bounds, configuration: webViewConfiguration) ignisignWebView.autoresizingMask = [.flexibleWidth, .flexibleHeight] view.addSubview(ignisignWebView) // Configure session dimensions let dimensions = IgnisignSignatureSessionDimensions( width: "100%", height: "100%" ) // Configure display options let displayOptions = IgnisignJSSignatureSessionsDisplayOptions( hideTitle: true ) // Set initialization parameters let initParams = IgnisignInitParams( signatureRequestId: signatureRequestId, signerId: signerId, signatureSessionToken: signatureSessionToken, // Session token from your backend signerAuthSecret: signerAuthSecret, // Required for embedded integration dimensions: dimensions, displayOptions: displayOptions ) // Set values and initialize session ignisignWebView.setValues(initParams: initParams) ignisignWebView.initSignatureSession() } // MARK: - IgnisignJS_SignatureSession_Callbacks func onSignatureSessionCompleted(data: String) { // Handle successful signature completion print("Signature completed: \(data)") let alert = UIAlertController(title: "Success", message: "Signature completed successfully", preferredStyle: .alert) alert.addAction(UIAlertAction(title: "OK", style: .default) { _ in self.navigationController?.popViewController(animated: true) }) present(alert, animated: true) } func onSignatureSessionError(error: String) { // Handle signature error print("Signature error: \(error)") let alert = UIAlertController(title: "Error", message: "An error occurred: \(error)", preferredStyle: .alert) alert.addAction(UIAlertAction(title: "OK", style: .default)) present(alert, animated: true) } func onSignatureSessionCanceled(reason: String) { // Handle signature cancellation print("Signature canceled: \(reason)") let alert = UIAlertController(title: "Canceled", message: "Signature process was canceled", preferredStyle: .alert) alert.addAction(UIAlertAction(title: "OK", style: .default) { _ in self.navigationController?.popViewController(animated: true) }) present(alert, animated: true) } func onSignatureSessionProgress(progress: String) { // Handle signature progress updates print("Progress: \(progress)") } } ``` -------------------------------- ### Get Document Context Source: https://ignisign.io/docs/ignisign-api/get-document-context Retrieves the context of a specific document by its ID. ```APIDOC ## GET /v4/documents/:documentId/context ### Description This endpoint retrieves the context of a specific document. ### Method GET ### Endpoint /v4/documents/:documentId/context ### Parameters #### Path Parameters - **documentId** (string) - Required - The unique identifier of the document. ``` -------------------------------- ### Get Signature Images (Base64) Source: https://ignisign.io/docs/ignisign-api/signature-proof This endpoint retrieves the image of a signature from a document. ```APIDOC ## Get Signature Images (Base64) ### Description This endpoint retrieves the image of a signature from a document. ### Method GET ### Endpoint /signature-proof/signature-image ### Parameters #### Query Parameters - **documentId** (string) - Required - The ID of the document. - **signerId** (string) - Required - The ID of the signer. ``` -------------------------------- ### Import IgniSign SDK Source: https://ignisign.io/docs/quick-start/signature-interface/iOS_Integration Import the necessary frameworks for IgniSign integration in your Swift file. ```swift import UIKit import ignisign_ios import WebKit ``` -------------------------------- ### Get Signature Request Context Source: https://ignisign.io/docs/ignisign-api/get-signature-request-context Retrieves the context of a signature request by its ID. ```APIDOC ## GET /signature-request/{signatureRequestId}/context ### Description Retrieves the context of a signature request, providing details about its configuration, status, and associated entities. ### Method GET ### Endpoint /signature-request/{signatureRequestId}/context ### Parameters #### Path Parameters - **signatureRequestId** (string) - Required - The unique identifier of the signature request. ### Response #### Success Response (200) - **_id** (string) - The unique identifier of the signature request. - **_createdAt** (date-time) - The timestamp when the signature request was created. - **appId** (string) - Required - The application identifier. - **appEnv** (string) - Required - The execution environment of the application. Possible values: [`DEVELOPMENT`, `STAGING`, `PRODUCTION`]. - **signatureRequestType** (string) - Required - The type of signature request. Possible values: [`STANDARD`, `SIGNER_SETUP`, `SEAL`, `SEAL_M2M`, `BARE_SIGNATURE`]. - **title** (string) - The title of the signature request. - **description** (string) - The description of the signature request. - **language** (string) - The language for the signature session. Possible values: [`AR`, `BG`, `BN`, `CS`, `DA`, `DE`, `EL`, `EN`, `ES`, `ET`, `FI`, `FR`, `GA`, `HI`, `HR`, `HU`, `IS`, `IT`, `JA`, `KO`, `LT`, `LV`, `MT`, `NL`, `NO`, `PL`, `PT`, `RO`, `RU`, `SK`, `SL`, `SQ`, `SR`, `SV`, `TR`, `UK`, `ZH`]. - **status** (string) - Required - The current status of the signature request. Possible values: [`DRAFT`, `LAUNCHING`, `LAUNCH_ERROR`, `READY`, `IN_PROGRESS`, `COMPLETED`, `EXPIRED`, `FAILED`, `CANCELLED`, `PROCESSING`, `CHILDREN_GENERATED`]. - **externalId** (string) - An identifier to link the signature request to an external system. - **creatorId** (string) - The ID of the user who created the signature request. - **documentIds** (string[]) - The IDs of the documents linked to the signature request. - **signerIds** (string[]) - The IDs of the signers invited to the signature request. - **signedBy** (string[]) - The IDs of the signers who have already signed. - **expirationDate** (date-time) - The expiration date of the signature request. - **expirationDateIsActivated** (boolean) - Indicates whether the expiration date is activated. - **diffusionMode** (string) - The diffusion mode of the signature request. Possible values: [`WHEN_READY`, `SCHEDULED`]. - **diffusionDate** (date-time) - The diffusion date if `diffusionMode` is `SCHEDULED`. - **initialSignatureRequestId** (string) - The identifier of the initial signature request if generated from a signature profile with `individualizeRequests` activated. - **signerIdsAsApprover** (string[]) - The IDs of signers who will be approvers. - **recipients** (string[]) - The emails of recipients who will receive a copy of the signed document. - **appEnvSettingVersion** (number) - The version of the application environment settings. - **defaultSignatureMethod** (string) - Required - The default signature method. Possible values: [`SIMPLE_STD`, `ADVANCED_SMS`, `ADVANCED_STD`]. - **signerProfilesUsed** (object[]) - An array of signer profiles used. - **signerProfileId** (string) - Required - The ID of the signer profile. - **signatureMethodRef** (string) - Required - The signature method reference. Possible values: [`SIMPLE_STD`, `ADVANCED_SMS`, `ADVANCED_STD`]. - **version** (number) - Required - The version of the signer profile. - **signerIds** (string[]) - Required - The IDs of the signers associated with the profile. - **individualizeRequests** (boolean) - Indicates if signature requests were individualized for each signer. - **m2mId** (string) - The machine-to-machine identifier. #### Response Example ```json { "_id": "sigreq_abc123", "_createdAt": "2023-10-27T10:00:00Z", "appId": "app_xyz789", "appEnv": "DEVELOPMENT", "signatureRequestType": "STANDARD", "title": "Document for Signature", "description": "Please sign this document at your earliest convenience.", "language": "EN", "status": "IN_PROGRESS", "externalId": "ext_ref_456", "creatorId": "user_789", "documentIds": ["doc_123", "doc_456"], "signerIds": ["signer_abc", "signer_def"], "signedBy": ["signer_abc"], "expirationDate": "2023-11-27T10:00:00Z", "expirationDateIsActivated": true, "diffusionMode": "WHEN_READY", "diffusionDate": null, "initialSignatureRequestId": null, "signerIdsAsApprover": [], "recipients": ["recipient@example.com"], "appEnvSettingVersion": 1, "defaultSignatureMethod": "SIMPLE_STD", "signerProfilesUsed": [ { "signerProfileId": "profile_1", "signatureMethodRef": "SIMPLE_STD", "version": 1, "signerIds": ["signer_abc"] } ], "individualizeRequests": false, "m2mId": "m2m_123" } ``` ``` -------------------------------- ### POST /v4/applications/:appId/envs/:appEnv/init-documents Source: https://ignisign.io/docs/ignisign-api/init-document Initializes a document, creating a document object that will be used to link content to a signature request. This is a required step before providing the document's content. ```APIDOC ## POST /v4/applications/:appId/envs/:appEnv/init-documents ### Description Initializes a document, creating a document object that will be used to link content to a signature request. This is a required step before providing the document's content. ### Method POST ### Endpoint /v4/applications/:appId/envs/:appEnv/init-documents ### Parameters #### Path Parameters - **appId** (string) - Required - The application identifier which is used to identify the application used. - **appEnv** (string) - Required - The execution environment of the application where request are executed. Possible values: [DEVELOPMENT, STAGING, PRODUCTION] #### Request Body - **signatureRequestId** (string) - Required - The unique identifier of the signature request associated with the document initialization. - **label** (string) - Optional - A user-friendly label to identify the document. - **description** (string) - Optional - A detailed, human-readable description of the document. - **externalId** (string) - Optional - An optional external identifier that can be used to reference the document from external systems. It's a free text. Ignisign's system do not interprete it. ``` -------------------------------- ### Get Document Information Source: https://ignisign.io/docs/ignisign-api/get-document-by-id Retrieves specific documents information by its unique identifier. ```APIDOC ## GET /v4/documents/:documentId ### Description This endpoint retrieves specific documents information. ### Method GET ### Endpoint /v4/documents/:documentId ### Parameters #### Path Parameters - **documentId** (string) - Required - The unique identifier of the document. ``` -------------------------------- ### Node.js Webhook Handler with Ignisign SDK Source: https://ignisign.io/docs/quick-start/backend-integration/Webhooks_Integration This example demonstrates setting up an Express.js server to handle Ignisign webhooks using the Node.js SDK. It includes token verification and processing of signature-related events. ```javascript const express = require('express'); const { IgnisignClient } = require('@ignisign/node'); // Initialize Ignisign client const ignisign = new IgnisignClient({ appId: 'your-app-id', appEnv: 'PRODUCTION', apiKey: 'your-api-key' }); // Setup webhook handler const app = express(); app.use(express.json()); app.post('/api/ignisign-webhooks', async (req, res) => { try { const { appId, appEnv, topic, action, msgNature, content, verificationToken } = req.body; // Verify the webhook token const isValid = await ignisign.client.tokensV4.checkConsumeWebhook({ token: verificationToken, appId, appEnv }); if (!isValid) { console.error('Invalid webhook token'); return res.status(401).send('Invalid token'); } // Process based on topic and action switch(topic) { case 'SIGNATURE': if (action === 'SIGNATURE_SUCCESS') { const { signatureRequestId, signerId } = content; console.log(`Signature completed for request ${signatureRequestId} by signer ${signerId}`); // Update your database or trigger business logic await updateSignatureStatus(signatureRequestId, 'completed'); } break; case 'SIGNATURE_PROOF': if (action === 'GENERATED') { const { signatureRequestId, signatureProofUrl } = content; console.log(`Signature proof generated for request ${signatureRequestId}`); // Store the proof URL or download the proof documents await storeSignatureProof(signatureRequestId, signatureProofUrl); } break; // Handle other topics and actions } // Acknowledge receipt res.status(200).send('Webhook processed successfully'); } catch (error) { console.error('Error processing webhook:', error); res.status(500).send('Error processing webhook'); } }); app.listen(3000, () => { console.log('Webhook server listening on port 3000'); }); ``` -------------------------------- ### Get Signer Input Constraints Source: https://ignisign.io/docs/ignisign-api/get-signer-inputs-constraints-from-signer-profile-id Retrieves the input constraints for a signer profile. ```APIDOC ## GET /v4/applications/:appId/envs/:appEnv/signer-profiles/:signerProfileId/inputs-needed ### Description This endpoint retrieves the input constraints for a signer profile. ### Method GET ### Endpoint /v4/applications/:appId/envs/:appEnv/signer-profiles/:signerProfileId/inputs-needed ### Parameters #### Path Parameters - **appId** (string) - Required - The application identifier which is used to identify the application used. - **appEnv** (string) - Required - The execution environment of the application where request are executed. Possible values: [`DEVELOPMENT`, `STAGING`, `PRODUCTION`] - **signerProfileId** (string) - Required - The unique identifier of the related signer profile. ``` -------------------------------- ### Initialize IgniSign NodeJS SDK Source: https://ignisign.io/docs/core-concepts/Bare_Signatures Initializes the IgniSign NodeJS SDK with application credentials and environment settings. Ensure you have the necessary `appId`, `appEnv`, and `appSecret`. ```typescript import { IgniSignSdk } from '@ignisign/ignisign-sdk'; try { const ignisignSdkInstance = new IgniSignSdk({ appId, appEnv, appSecret, displayWarning: true, }); await ignisignSdkInstance.init(); } catch (e) { console.error("Error when initializing IgniSign Service", e); } ``` -------------------------------- ### Initialize Ignisign Client with OAuth Token Source: https://ignisign.io/docs/sdks/examples/node-js Initialize the Ignisign client using an OAuth token as the API secret. Ensure the correct environment and version are specified. ```javascript const client = new IgnisignClient({ apiId: 'your-api-id', apiSecret: accessToken, // The OAuth token env: IGNISIGN_ENV.DEVELOPMENT, version: IGNISIGN_VERSION.V4, }); ```