Docs
PHP

PHP

Learn how to create your first sigature request using the DigiSign PHP SDK.

Prerequisites

To get the most out of this guide, you’ll need to:

Install

Get the DigiSign PHP SDK.

composer require digisign/php-sdk

Authenticate

The DigiSign API requires authentication via an API Key. Learn More.

Call createSession to authenticate. Each session expires every 6 minutes.

$sessions = createSession('ds_123456789');

Transform a template to a Request

The easiest way to create a request is by using the transform method.

function main() {
    try {
        $session = createSession('ds_123456789');
        $workspaceId = "ws_1234567890";
 
        $data = [
            "recipients" => [
                [
                    "id" => "tmp-abcdefg123456789", // Must match corresponding alias ID from the selected template
                    "name" => "Jessica Lee",
                    "email" => "jessicalee@example.com"
                ]
            ]
        ];
 
        $session->requests->workspace($workspaceId)->transform($data);
    } catch (Exception $error) {
        echo $error->getMessage();
    }
}
 
main();

Recipients ID must match a corresponding alias ID from the selected template.

Try it yourself

Was this page helpful?