Account


Earned badges

Achievement: Latest Unlocked

Topic Started

Topics

Replies Created

Reply to: Package Create - Cannot send package without approvals.

0 votes

Hi Duo,

Please find our JSON 

$json = array(
            'type' => 'PACKAGE',
            'status' => 'SENT',
            'roles' => array(
                array(
                    'id' => '12345',
                    'type' => 'SIGNER',
                    'signers' => array(
                        array(
                            'email' => '[email protected]',
                            'firstName' => 'John',
                            'lastName' => 'Smith',
                            'id' => '12345',
                        )
                    ) ,
                ) ,
                array(
                    'id' => 'Sender1',
                    'type' => 'SIGNER',
                    'signers' => array(
                        array(
                            'email' => '[email protected]',
                            'firstName' => 'Mike',
                            'lastName' => 'Smith',
                            'id' => 'Sender1',
                        )
                    ) ,
                ) ,
            ) ,
            'name' => 'PHP Application Example',
            'documents' => array(
                        array(
                            'name' => 'sample',
                            'id' => 'contract',
                            'extract' => 'true'
                        )
                    )
        );
 


Reply to: Package Create - Cannot send package without approvals.

0 votes

Hi Duo,

The new document with the tag also gets the same error. 

 

<?php
    error_reporting(1);
    define("API_URL", "https://sandbox.esignlive.com/api/packages");
    define("MULTIPART_BOUNDARY", "----WebKitFormBoundary7MA4YWxkTrZu0gW"); 

    $api_headers = array(
        "Authorization: Basic XXXXXXXXXXXXXXXXXXXXXXXXXXXXXNg==",
        "Accept: application/json; esl-api-version=11.0",
        "Content-Type: multipart/form-data; boundary=\"" . MULTIPART_BOUNDARY . "\"",
    );

    $json = array(
            'type' => 'PACKAGE',
            'status' => 'SENT',
            'roles' => array(
                array(
                    'id' => 'Borrower',
                    'type' => 'SIGNER',
                    'name'=> 'Borrower',
                    'signers' => array(
                        array(
                        'name'=> 'Borrower',
                            'email' => '[email protected]',
                            'firstName' => 'John',
                            'lastName' => 'Smith',
                            'id' => 'Borrower',
                        )
                    ) ,
                ) ,
                array(
                    'id' => 'Lender',
                    'type' => 'SIGNER',
                    'name'=> 'Lender',
                    'signers' => array(
                        array(
                        'name'=> 'Lender',
                            'email' => '[email protected]',
                            'firstName' => 'Mike',
                            'lastName' => 'Smith',
                            'id' => 'Lender',
                        )
                    ) ,
                ) ,
            ) ,
            'name' => 'PHP Application Example',
            'documents' => array(
                        array(
                            'name' => 'SampleTextTags',
                            'id' => 'contract',
                            'extract' => 'true'
                        )
                    )
        );

    $postdata = "--" . MULTIPART_BOUNDARY . "\r\n";
    $postdata .= "Content-Disposition: form-data; name=\"file\"; filename=\"SampleTextTags.pdf\"\r\n\r\n";
    $postdata .= file_get_contents("SampleTextTags.pdf");
    $postdata .= "\r\n\r\n";
    $postdata .= "--" . MULTIPART_BOUNDARY . "\r\n";
    $postdata .= "Content-Disposition: form-data; name=\"payload\"\r\n\r\n";
    $postdata .= json_encode($json);
    $postdata .= "\r\n\r\n";
    $postdata .= "--" . MULTIPART_BOUNDARY . "--\r\n";

    $curl = curl_init(API_URL);
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($curl, CURLOPT_POST          , true);
    curl_setopt($curl, CURLOPT_POSTFIELDS    , $postdata);
    curl_setopt($curl, CURLOPT_HTTPHEADER    , $api_headers);
    curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
    curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
    curl_exec($curl);
    $response = curl_multi_getcontent($curl);
    curl_close($curl);

    echo mb_convert_encoding(print_r(json_decode($response, true), true), 'CP932', 'UTF-8'); 

?>
 


Subscriptions

Topics Replies Freshness Views Users
7 10 months 2 weeks ago 119
Profile picture for user Duo_Liang

Code Share

This user has not submitted any code shares.

Subscriptions Release Notes

This user is not subscribed to any release notes.