Appfarm Documentation
Getting startedDocumentationCommunityAppfarm Create
  • Overview
  • Getting Started
    • What is Appfarm?
    • Key concepts
    • Quickstart
      • Speed intro
      • Step-by-step guide
    • Appfarm Showroom
    • FAQ
  • Appcademy
    • Learning paths
    • Appfarm Fundamentals
      • Intro Course
        • 1. Intro to No-Code and Appfarm
        • 2. Navigation in Appfarm Create
        • 3. What is Apps?
        • 4. Intro to UI Editor
        • 5. Data Model
        • 6. App Data
        • 7. Actions
        • 8. Tips and Tricks
        • 9. Intro to practical walkthrough
        • 10. Create a details view of a Project
        • 11. Create a Custom List
        • 12. Swipe and Delete
        • 13. Functionality for simple Create of Data
        • 14. Upload and Download Photos
        • 15. Input Dialog with Validation and Save
        • 16. Dashboard
        • 17. Summary
        • Quiz
      • User Interface Fundamentals
        • Container - Sectioning, Styling and Repeating
        • Conditional Styles
        • Motions
        • Responsive Design
        • Step-by-step workflow
        • Featured UI Components
        • Quiz
      • App Data Fundamentals
        • Data Source Filtering
        • App Variables and Runtime Properties
        • URL Parameters
        • Quiz
      • Actions & Logic Fundamentals
        • Event Handlers
        • Featured Action Nodes
        • Context Parameters
        • Quiz
      • Services Fundamentals
        • Introduction to Services
        • Setting up a Service
        • Scheduling a Service
      • Integration Fundamentals
        • The web request action node
        • Fetch data from an endpoint
        • Map data to a data source
        • Modify the response
        • Nested data mapping
        • Path parameters
        • Authentication
        • Send data to an endpoint
        • Quiz
      • User handling and permissions
        • Users and roles
        • Permissions
        • Creating users
        • Extending the User object class
        • Updating and deleting users
        • Unauthenticated access
        • Quiz
    • Appfarm Professional
      • User Interfaces
        • Featured UI Components
        • Concepts and Use Cases
      • Data Structures & Data Handling
        • Data Features
        • Search & Filters
        • Featured Action Nodes
        • GraphQL
      • Logic & Flow
        • Logical Concepts
        • Date and Time Handling
        • Featured Action Nodes
        • Exception Handling
      • Login & Configuration
        • Login and Authentication
        • Settings, Configuration and Languages
      • Security & Operations
        • Security and Permissions
        • Deployment
        • Schedules and Logs
        • Debugging and App Health
      • Performance & Optimization
        • Optimizing Performance
        • Enhancing Functionality
    • Appfarm Sales Representative
    • Appfarm Developer Forum
      • Session 1: Data Modeling in Appfarm Create
      • Session 2: App Data in Appfarm Create
      • Session 3: Services in Appfarm Create
      • Session 4: Optimizing Performance
    • Background
      • Databases
        • Data modeling 101
        • Database normalization
  • Library
    • UI components
      • Advanced bar chart
      • Advanced bubble chart
      • Advanced combined chart
      • Advanced gantt chart
      • Advanced heatmap chart
      • Advanced line/area chart
      • Advanced pie chart
      • Advanced scatter plot chart
      • Advanced solid gauge chart
      • Animated component
      • Avatar
      • Avatar group
      • Basic bar chart
      • Basic gauge chart
      • Basic line chart
      • Basic pie chart
      • Bottom navigation
      • Button
      • Checkbox
      • Chip group
      • Circular progress
      • Coded component
      • Container
      • Date & time picker
      • Drawable canvas
      • Floating action button
      • Icon
      • Icon button
      • Iframe
      • Image
      • Linear progress
      • List
      • Map
      • Menu list
      • Multi select
      • PDF reader
      • Popover
      • Radio buttons
      • Rich text editor
      • Rich text
      • Select
      • Slider
      • Speed dial
      • Switch
      • Table
      • Tabs
      • Text
      • Text edit
      • View container
      • Visibility group
    • Action nodes
      • Aggregate data
      • Advanced search
      • Auth operations
      • Block
      • Catch exception
      • Copy to clipboard
      • Create file archive
      • Create file object
      • Create object
      • Create user account
      • Delete objects
      • Delete user account
      • Duplicate objects
      • End execution
      • Exit block
      • Exit loop
      • Export data
      • Foreach
      • Generate document
      • If
      • Import data
      • Invalidate cache
      • Log in
      • Log to console
      • Log out
      • Next iteration
      • Navigate
      • Open/close popover
      • Open confirm dialog
      • Open print dialog
      • Open snackbar
      • Open Unsplash dialog
      • Open URL
      • Persist objects
      • Push notifications
      • Read objects
      • Request permissions
      • Run code
      • Run other action
      • Run service
      • Scan barcode/QR code
      • Send email
      • Send SMS
      • Set client language
      • Set data source attributes
      • Set selection
      • Set theme
      • Set user account image
      • Show install app prompt
      • Sleep
      • Sort objects
      • Throw exception
      • Toggle drawer
      • Update object
      • Update secret
      • Update user account
      • Web request
      • While
  • Reference
    • Appfarm Create
      • Appfarm Commander
      • Blue dots
      • Copy & Paste
      • Farmer's Market
      • Find references
      • Find usage
      • Keyboard shortcuts
      • Undo/Redo
      • User preferences
    • Platform concepts
      • Conditions
      • Data bindings
      • Date and time
      • Event handlers
      • Filters
      • Functions
      • Markdown
      • Objects
      • Operators
      • Value processor
    • Dashboard
    • Apps
      • UI
        • Views
          • Dialog
          • Drawer
        • Layout designer
        • Component properties
        • Shareable UI components
      • Data
        • App variables
        • Data sources
        • Calendar data sources
      • Actions
      • App settings
      • App size
      • App health
    • Services
      • Service Endpoints
      • Service settings
      • Service health
      • API explorer
    • Data model
      • Object classes
      • Object class properties
      • Enumerated types
      • GraphQL
        • Queries
        • Mutations
      • Data Extract API
      • Time series data
    • Operations
      • Deploy
      • Schedules
      • Logs
    • Resources
      • Themes
      • Files
      • Fonts
      • Internationalization
    • Configuration
      • Environments
      • Login
        • Custom auth providers
    • Security
      • Users
      • Service accounts
      • Roles
      • Secrets
      • Permissions
        • Conditional Permissions
    • Appfarm Client
      • Developer tools for Apps
      • Developer tools for Services
      • Warnings and errors
  • How to
    • Data modeling
      • Many-to-many relationships
      • Use naming conventions
      • Offline data handling
      • Data silos and White labelling
    • User interface
      • Manage a many-to-many relationship with a Chip group
      • Configure drag and drop
      • Build a drag-and-drop calendar
      • Design a responsive layout
      • Work with flexbox
      • Use Mapbox as a map layer
      • Understand charts
    • Logic and flow
      • Event Log Design
      • Configure advanced search
    • Themes and styling
      • Change the active theme
      • Add custom email templates
    • Enhance your app
      • Add deep links
      • Add keyboard shortcuts
      • Add link previews for social media
      • Apply SEO best practices
      • Change the active language
      • Generate a PDF from a Container
    • Integrations
      • Integrate with external systems
      • Integrate with OpenAI
      • Integrate with Google Analytics (GA4)
      • Configure a custom email account
      • Integrate with a payment provider
      • Integrate with Signicat
      • Integrate directly with an external database
      • Retrieve a Bearer token from Google Cloud
      • Fetch data from BigQuery
      • Retrieve access token from Microsoft Entra ID
    • Workflow automation
      • Update an OAuth 2.0 access token from a service
    • Authentication and access control
      • Add users and assign roles
      • Configure unauthenticated access
      • Implement third-party authentication
    • Security, testing and deployment
      • Add a custom domain
      • Install an app on a device
      • Get ready for Production
      • Optimize performance
      • Security checklist
      • Test and debug
    • Example apps
      • Create an Instagram clone
        • The end result
        • Designing the feed
        • Create new post
        • Add a like-button
        • Add comment-functionality
  • Solution administration
    • Subscription and billing
    • Dedicated tier benefits
    • Guide to GDPR
      • Key principles
      • How Appfarm protects personal data
      • How you can protect your clients’ data
      • Glossary
    • Appfarm and the EU AI Act
  • Policies
    • Appfarm Policies
    • Data Processors
    • Privacy Policy
Powered by GitBook
On this page
  • Step 1 - Create API Client in Signicat
  • Step 2 - Create Secrets in Appfarm Create
  • Step 3 - Create the Service and Schedule for getting the Bearer Token from Signicat
  • Step 4 - Action for sending a document to Signicat
  • Step 5 - Get notifications when a document is signed, and download the signed file

Was this helpful?

Export as PDF
  1. How to
  2. Integrations

Integrate with Signicat

PreviousIntegrate with a payment providerNextIntegrate directly with an external database

Last updated 1 year ago

Was this helpful?

Signicat is a provider of digital identity solutions all over Europe. Products include identity proofing, authentication and electronic signatures. In this guide, we will specifically take a look at how to send a PDF file for digital signatures (e-signature).

To get started with this guide, you a paid account or a free test account and get the required API credentials to integrate with Signicat. If you don’t have done this yet, you can do so by clicking .

Step 1 - Create API Client in Signicat

All communication with the API requires a Bearer token. A Bearer token is valid a certain amount of time, and a new Bearer token may be retrieved using the same API with a given client ID and secret as input.

You need to get the Client ID and Secret from Signicat.

  • Log into Signicat (link to Test environment ).

  • Go to Account -> API Clients and create a new client. Name it whatever you want.

  • Choose OAuth/OpenID Config and tick off identity, event, document_file, document_read and document_write under Scope.

  • Copy the Client ID and Secret to your notepad as you will need it later.

Step 2 - Create Secrets in Appfarm Create

Inside Appfarm Create, go to Security -> Secrets and add the following Secrets:

  • Signicat Client ID: Tick Environment Specific. Secret Type should be String. Copy the Value saved in step 1 into Development and Test. The reason for this is that we have retrieved the Client ID and Secret for the Signicat Test Environment in Step 1, and we would like to use it only for the Appfarm Development and Test Environment. You will need to get another Client ID and Secret for the Signicat Production Environment (from the )

  • Signicat Client Secret: Tick Environment Specific. Secret Type should be String. Copy the Value saved in step 1 into Development and Test.

  • Signicat Endpoint Get token (optional): Secret Type should be String. Value should be . We recommend saving the hostname we integrate towards as a Secret, and using the Secret in Web Requests instead of hardcoded URLs in Web Requests. The URL for getting Bearer token is the same for Test and Production, hence no "Environment Specific" setting.

  • Signicat Bearer Token: Tick Environment Specific. Secret Type should be String. Leave values blank.

The Signicat Bearer Token should be updated regularly with the Bearer Token received from Signicat from a Service (see next 2 steps). So, the Service Account that should run the Service should be a member of a dedicated Role, and that Role needs access to update this Secret as well.

  • Identify the Role, or create the Role, for the Service Account that should run the Service. If no such Service Account or Role exists: Create the Role, e.g. Signicat Service Role, and the Service Account Signicat Service User (make it a member of the Signicat Service Role)

  • Go to Security -> Permissions -> Advanced, and locate the settings allowing Signicat Service Role to Update Secret Signicat Bearer Token.

Step 3 - Create the Service and Schedule for getting the Bearer Token from Signicat

Create a Service for getting the Signicat Bearer Token. The Service Endpoint should execute an Action with the following Action Nodes:

1. Action Node: Web Request

In the above screenshot, the Web Requests connect to the URL defined in Step 1. Also:

  • Request Header: Add an entry Authorization with a value defined by the function return Basic ${signicatClientSecret} (signicatClientSecret is the secret defined in Step 2, added as a Function Parameter)

  • Method: POST

  • Body Type: URL-encoded

  • Body Content: 2 entries:

    • Key: grant_type, Value: client_credentials

    • Key: scope, Value: document_read document_write document_file event

2. Action Node: Update Secret

Add the Update Secret Action Node. This is where you should update the Secret Signicat Bearer Token with the value received (and temporarily stored in a Service Variable):

Having the Bearer Token automatically updated and all Appfarm Permissions and Signicat Permissions set up correctly, we are now ready to actually send a document for signature.

Step 4 - Action for sending a document to Signicat

In this step, we go through the steps for sending a document to Signicat for electronic signature. Note that in this process, we send the document (as a base64 string), some info and parameters, and the name/email(s) of the signer(s) to Signicat. We will get back an ID of the Document as well as the URL(s) for signing the document. And we may choose in the parameter input to Signicat whether we want Signicat to send the email to the signers, or if we want to use the received URL(s) and send the emails from Appfarm.

Create an Action in Appfarm for sending the Document. You may create the Action in an App or a Service.

1. Convert the PDF to a base64 string

First, add a Web Request as follows:

  • URL: The File Content property of the document (stored in Appfarm)

  • Method: GET

  • Response Type: Arraybuffer

  • Result Parser: This is where the "magic" lies: Converting the binary stream into a base64 string. Add the following code to the Result Parser:

let res = new Uint8Array(rawResponseData)
const chunkSize = 10000
const chunks = Math.ceil(res.length / chunkSize)
console.log({ chunkSize, chunks })

let thing = ""
for (let i = 0; i < chunks; ++i) {
  const part = res.slice(i * chunkSize, (i + 1) * chunkSize)
  thing += String.fromCharCode.apply(null, part)
}

let base64String = btoa(thing);
return {base64String}
  • Result Mapping: You will need to map base64String to the App Variable or runtime property where you want to store the base64 version of the document temporarily.

2. Send the document for signature to Signicat

  • URL: The endpoint, as found in the above link (https://api.signicat.io/signature/documents).

  • Authorization: Bearer Token

  • Auth Token: The Secret holding the Bearer Token.

  • Prefix Bearer Token: Tick this one (added the word "Bearer" in front of the token in the Auth header generated)

  • Method: POST

  • Body Content: A function returning the JSON. Example:

return `
{
  "title": "Test document",
  "signers": [
    {
      "externalSignerId": "${personID}",
      "redirectSettings": {
        "redirectMode": "donot_redirect"
      },
      "signatureType": {
        "mechanism": "pkisignature"
      },
    }
  ],
  "dataToSign": {
    "title": "${contractTitle}",
    "description": "Contract for signing",
    "base64Content": "${base64String}",
    "fileName": "${contractFilename}",
  },
  "contactDetails": {
    "email": "support@vendorcomp.com",
    "url": "https://vendorcomp.com"
  },
  "externalId": "${contractID}",
  "description": "This is an important document"  
}
`
  • Result Mapping: You must at least map and save the returned documentId and the URL of the signers (if 1 signer, you may map the property signers.0.url). Also, you should save the property status.documentStatus (the string "unsigned" is returned initially)

Step 5 - Get notifications when a document is signed, and download the signed file

Until this step, you have functionality for sending a document for signature, and saving the unique Document ID (Signicat's reference to the document) and URL for signing the document. We would like to know when the Document is signed.

There are 2 ways of getting the status of the Document:

Result Mapping: Create a Service Variable Access Token (string). Set up the Result Mapping as follows:

Now, you may test this Service from to make sure it works. When verified, you may create a (running e.g. every 30 minutes) to execute the Service you just created. Remember that the Schedule must be set up with the Service Account defined in Step 2.

See the where you can find the URL for the API Endpoint in Signicat, as well as the structure of the JSON to be sent. You will need to set up a Web Request:

If you are sending the emails to the signers, you may now add the action node(s) for sending the email(s) to the signer(s) with your predefined text, the PDF itself as an attachment (optional) and - most importantly - the URL for signing the document. Note that clicking the URL will open Signicat's solution, where the user must log in and sign the document.

Use the . Just add a Service with an action that checks the status of all unsigned documents. Let it be executed e.g. every hour or day.

Use the . You may create a webhook in Signicat's, and a Service Endpoint in Appfarm. Then, connect the webhook to the endpoint, and Signicat will send updates to the document status automatically!

When the status is signed, you may download the file and save it in Appfarm using .

this link
here
Signicat Production Dashboard
https://api.signicat.io/oauth/connect/token
Swagger
Service Schedule
following link
Send Email
Status API
Notifications API
this API