Setup with unique user IDs for every Signer

Signing with unique user IDs - having the documents signed within your website or app by signers with unique user IDs.

Every signing session in this scenario is set up individually for every Signer and every document. You can identify every signing operation by the unique document ID and unique user ID.

Steps

1. One-time setup

1.1. Create a Sender account
1.2. Get an access token for the Sender

You can use your own token and account credentials as Sender’s.

2. Setup for every document you’d like to embed

2.1. Create a document as Sender (3 methods)
2.2. Create a Signer account

The number of Signers must be equal to the number of roles in one document.

2.3. Create the invite to sign that document
2.4. Generate restricted scope access token for a signing link
2.5. Generate the signing link to the document
2.6. (optional) Adjust your application to showing the signing link according to the signing order.

▶ Create a Sender account (1.1)

The Sender’s email address and password are used as sender_email and sender_password values below.

You can use your own account credentials as Sender account or create a separate user.

▶ Get an access token for the Sender (1.2)

Use your own bearer token as Sender’s access token, or generate a new access token if you created a new user for the Sender.

Use the Sender’s token as sender_access_token value in the next steps.

▶ Create a document as Sender (2.1)

Method 1: Use a template that has been previously created in your account.

Generate a document from a template with one role.

curl -X POST \
https://api-eval.signnow.com/template/{{sender_template_id}}/copy \
-H 'Authorization: Bearer {{sender_access_token}}' \
-H 'Content-Type: application/json' \
-d '{"document_name":"doc_from_template"}'

Method 2: Upload a document with text tags on it.

curl -X POST \
  https://api-eval.signnow.com/document/fieldextract \
  -H 'Authorization: Bearer {{USER_1_ACCESS_TOKEN}}' \
  -H 'Content-Type: multipart/form-data' \
  -F 'file=@/path/to /your/file/pdf-test.pdf' \
  -F 'Tags=[
  {
    "tag_name": "email",
    "role": "Signer 1",
    "label": "email",
    "required": true,
    "type": "text",
    "prefilled_text": "test@example.com",
    "validator_id": "7cd795fd64ce63b670b52b2e83457d59ac796a39",
    "height": 15,
    "width": 100
  },
  {
    "tag_name": "name",
    "role": "Signer 1",
    "label": "name",
    "required": true,
    "type": "text",
    "height": 15,
    "width": 100
  }
	]'

Method 3: Upload a plain document and then add fields to it using the API.

Upload document
curl -X POST \
  https://api-eval.signnow.com/document \
  -H 'Authorization: Bearer {{USER_1_ACCESS_TOKEN}}' \
  -H 'content-type: multipart/form-data' \
  -F 'file=@/path/to/your/document/pdf-test.pdf'
Add fields
curl -X PUT \
  https://api-eval.signnow.com/document/{{document_id}} \
  -H 'Authorization: Bearer {{USER_1_ACCESS_TOKEN}}'\
  -H 'Content-Type: application/json' \
  -d '{
    "fields": [
      {
        "x": 305,
        "y": 18,
        "width": 122,
        "height": 10,
        "page_number": 0,
        "label": "first_name",
        "role": "Signer 1",
        "required": true,
        "type": "text",
        "prefilled_text": "John"
      },
      {
        "x": 305,
        "y": 38,
        "width": 122,
        "height": 10,
        "page_number": 0,
        "label": "last_name",
        "role": "Signer 1",
        "required": true,
        "type": "text",
        "prefilled_text": "Doe"
      },
      {
        "x": 305,
        "y": 67,
        "width": 100,
        "height": 34,
        "page_number": 0,
        "label": "a sample label",
        "role": "Signer 1",
        "required": true,
        "type": "signature"
      }
    ]
  }'

Create a Signer account (2.2)

Only one Signer account is needed and it will be re-used for every signing event. Keep this email address and password, you’ll use it as signer_email and signer_password values below.

The number of Signers must be equal to the number of roles in one document.

Create the invite to sign that document (2.3)

Make a POST /document/{{document_id}}/invite?email=disable call, with email=disable to prevent the delivery of an email invite:

curl -X POST \
  https://api-eval.signnow.com/document/{{document_id}}/invite?email=disable \
  -H 'Authorization: Bearer {{sender_access_token}}' \
  -d '{
  "to": [
    {
      "email": "{{signer_email}}",
      "role": "Signer 1",
      "order": 1,
      "role_id": ""
    }
  ],
  "from": "{{sender_email}}",
  "cc": [],
  "subject": "You received a signature request",
  "message": "Please, fill in and sign the attached document"
}'

▶ Generate restricted scope access token for a signing link (2.4)

Get an access_token with a scope specific to that document by making a POST /oauth2/token request for signer.

This returns signer_limited_scope_token.

curl -X POST \
  https://api-eval.signnow.com/oauth2/token \
  -H 'Authorization: Basic {{basic_authorization_token}' \
  -H 'content-type: multipart/form-data;' \
  -F 'username={{signer_email}}' \
  -F 'password={{signer_password}}' \
  -F 'grant_type=password' \
  -F 'scope=signer_limited_scope_token document/{{document_id}}'

Generate the signing link to the document (2.5)

The base URL for the link is: https://eval.signnow.com/dispatch?route=assign

The link requires the query parameters document_id and access_token.

https://eval.signnow.com/dispatch?route=fieldinvite&document_id={{DOCUMENT_ID}}&access_token={{signer_restricted_token}}

The signing link accepts optional query parameters:

  • redirect_uri: displays a ‘Thank you’ message after the document was signed
  • theme: displays neutral light-gray standard SignNow theme for the document signing session
  • disable_email: prevents sending the signed copy via email

Example query string: redirect_uri=%2Fdocument-saved-successfully&theme=neutral&disable_email=true

The full link will then be:

https://eval.signnow.com/dispatch?route=fieldinvite&document_id=DOCUMENT_ID&access_token=USER_2_RESTRICTED_ACCESS_TOKEN&redirect_uri=%2Fdocument-saved-successfully&theme=neutral&disable_email=true

Alternative Signing Link

This signing link automatically provides a mobile app signing link for iOS and Android device users:

https://eval.signnow.com/dispatch?route=fieldinvite&document_id={{DOCUMENT_ID}}&access_token={{signer_limited_scope_token}}

Optional Parameters: redirect_uri=%2Fdocument-saved-successfully

If a user is signing from a mobile device, add mobileweb=mobileweb_only query parameter to direct the user to the mobile web. If a user is on a desktop system, they are automatically directed to desktop signing.

To allow users to sign using the mobile web signature panel, add &use_signature_panel=1.

https://eval.signnow.com/dispatch?route=fieldinvite&document_id={{document_id}}&access_token={{signer_limited_scope_token}}&redirect_uri=%2Fdocument-saved-successfully&theme=neutral&disable_email=true