Quick Start

Complete your first envelope signing API call in 5 minutes.

Prerequisites

  • Application created in the Console with client_id and client_secret obtained
  • access_token obtained (see Authentication)
  • A PDF file ready

Step 1: Upload File

Base64-encode your PDF file and upload:

curl -X POST https://sgapi.tencent-esign.com/openapi/v1/files/upload \
  -H "Authorization: Bearer <access_token>" \
  -H "Content-Type: application/json" \
  -d '{
    "Files": [
      { "FileName": "contract.pdf", "FileBody": "<Base64-encoded content>" }
    ]
  }'

Returns a FileId, valid for 24 hours.

Step 2: Quick Create Envelope

Use the FileId to assemble and send an envelope:

curl -X POST https://sgapi.tencent-esign.com/openapi/v1/envelopes/quick-create \
  -H "Authorization: Bearer <access_token>" \
  -H "X-Operator-User-Id: <user-id>" \
  -H "Content-Type: application/json" \
  -d '{
    "BasicInfo": {
      "EnvelopeTitle": "Contract Signing",
      "SigningOrderType": "parallel"
    },
    "Documents": [
      { "DocumentId": "doc1", "FileId": "<FileId from Step 1>", "Order": 1 }
    ],
    "Signers": [
      {
        "RecipientId": "r1",
        "Name": "John Smith",
        "Email": "john@example.com"
      }
    ],
    "Tabs": [
      {
        "TabType": "signHere",
        "RecipientId": "r1",
        "DocumentId": "doc1",
        "Position": { "PageNumber": 1, "XPosition": 350, "YPosition": 700, "Width": 120, "Height": 40 }
      }
    ]
  }'

Returns an EnvelopeId, and the envelope immediately enters the signing workflow.

Generate signing links for the signers:

curl -X POST https://sgapi.tencent-esign.com/openapi/v1/envelopes/signing-view \
  -H "Authorization: Bearer <access_token>" \
  -H "Content-Type: application/json" \
  -d '{
    "EnvelopeId": "<EnvelopeId from Step 2>",
    "RecipientId": "r1"
  }'

Returns a SignerInfos list. Each item contains a SigningUrl — share the link with the signer to complete signing.

Step 4: Check Signing Status

curl -X POST https://sgapi.tencent-esign.com/openapi/v1/envelopes/detail \
  -H "Authorization: Bearer <access_token>" \
  -H "Content-Type: application/json" \
  -d '{ "EnvelopeId": "<EnvelopeId>" }'
💡

We recommend configuring callback notifications so the system proactively notifies you when signing is complete, eliminating the need for polling.

Next Steps

  • View detailed parameter documentation: API Reference
  • Configure callbacks to receive signing notifications: Callbacks