Send a document for signature via Connect (API)

API Request Structure

In this guide, you'll discover how to send a request with an document to sign passed as a binary via the optionsproperty.

Additionally, you'll learn how to interpret back the signature propertyreturn in the requestpayload.

API endpoint

https://connect.penbox.io/{version}/requests

Request Headers

You will find all the details regarding Payload Structure

AttributeDescriptionMandatory
Content-TypeIs always application/jsonYes
AuthorizationThis is where you can paste your authorization bearerYes

If you don't have an authorization bearer yet, please follow the instructions on the following page: https://dash.readme.com/project/penbox/v1/refs/getting-started-with-connect .

Request Payload Data Structure

You will find all the details regarding Payload Structure

AttributeDescriptionMandatory
user.localeThe language you want to use to send the email and formYes
user.phoneThe mobile phone number which you will send the signature requestNo
user.emailThe email to which you will send the signature requestYes
user.given_nameThe first name of the person to which you're sending the requestYes
user.family_nameThe last name of the person to which you're sending the requestYes
user.internal_refAn internal reference number that you have for the person/company that you're sending the request to.No
options.signature_methodsms, handwritten, null, emailYes
options.attachments_to_sign"base64": the format of the file to sign in base64
"name": the name of the file to sign
"metadata": the metadata of the file to sign
"type": the type of the file to sign, which is mostly pdf
Yes
owner.emailTo define the owner of the requestNo
flow.slugThe slug of the flow you want to useYes
{
    "user": {
        "email": "[email protected]",
        "locale": "fr",
        "given_name": "Olivia",
        "family_name": "Peeters",
        "internal_ref": "Penbox001"
    },
    "options" : {
        "signature_method": "email",
        "attachments_to_sign": {
            "base64": "" //Please insirt your file in a B64 format for this attribute,
            "name": "Quote Test Olivia.pdf",
            "metadata": {},
            "type": "application/pdf"
        }
    },
    "owner":{
        "email":"[email protected]"
    },    
    "flow": {
        "slug": "servicing-file-sign"
    }
}

Try your request

Lets try out our complete request.

Please be aware that the header will be differently according to the user.
To get your authorization bearer please follow the instructions on this page.

curl --location 'https://connect.penbox.io/v1/requests' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6ImNvbm5lY3QtMTYxNTU2MzUzMSJ9.eyJjbGllbnRfaWQiOiJwZW5ib3gtZGV2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"Olivia",
        "family_name": "Peeters",
        "internal_ref": "Penbox001"
    },
    "options" : {
        "signature_method": "email",
        "attachments_to_sign": {
            "base64": "" //Please insirt your file in a B64 format for this attribute,
            "name": "Quote Test Olivia.pdf",
            "type": "application/pdf"
        }
    },
    "owner":{
        "email":"[email protected]"
    },    
    "flow": {
        "slug": "servicing-file-sign"
    }
}'

👍

Congrats, at this point you should be able to create your own signature request via API

API Response Structure

On this section we will be explaining all the response details of a request signature property.

📘

Package to sign

Set of documents to be sign as a whole package (e.g: the contract & the general conditions)

⚠️

The signatures inner properties are the list of signature elements of the form

In the example describe here below signed_documents is the key defined for the signature element of the form servicing-file-sign

AttributeDescription
signed_documents.uriThe uri to get the signed document(s) on our CONNECT API (cf: this page)
signed_documents.nameThe name of the package to sign
signed_documents.typeThe format of the package to sign
signed_documents.statusThe status of the package to sign. When "finished" the package is signed
signed_documents.signed_filesThe list of files contained in the package to sign
"responses": [
        {
            "id": "1f2ebbbd-bd3c-45fd-b2b4-1c19bf4638c4",
            "data": {},
            "user": {},
            "attachments": [],
            "signatures": {
                "signed_documents": {
                    "id": "46080e25-8287-4669-b032-3f78d0f02958",
                    "uri": "https://connect.penbox.io/v1/signatures/46080e25-8287-4669-b032-3f78d0f02958",
                    "name": "my signed documents",
                    "type": "application/zip",
                    "status": "finished",
                    "signed_files": [
                    	{
                        "id": "a78f641a-62af-4d2f-94df-70de7d620001",
                        "uri": "attachments:a78f641a-62af-4d2f-94df-70de7d6200001",
                        "name": "my-signed-document.pdf",
                        "type": "application/pdf"
                      }
                    ]
                }
            }
        }
    ]