0
votes

Any One...

I am currently researching for a docusign signing & carbon copies feature. There are several ways that I tried doing that but I failed.

I am doing this from php, please note that I have no problem creating templates with signers only. It is the CarbonCopy feature where I could not make it work.

Here's my existing array to pass to docusign:

[ Array
(
    [0] => EnvelopeDealerListController::generateTemplateData
    [1] => Array
    (
        [accountId] => *****
        [emailSubject] => Document
        [emailBlurb] => Some Random Text
        [templateId] => 3C38D406-718D-4FF5-BA3A-05F58B3C0B7A
        [status] => sent
        [templateRoles] => Array
            (
                [0] => Array
                    (
                        [email] => [email protected]
                        [name] => John Doe
                        [roleName] => Signer
                        [clientUserId] => 1
                        [RoutingOrder] => 1
                    )

                [1] => Array
                    (
                        [email] => [email protected]
                        [name] => Jane Doe
                        [roleName] => Signer2
                        [clientUserId] => 2
                        [RoutingOrder] => 2


                    )

                [2] => Array
                    (
                        [email] => [email protected]
                        [name] => Joe Doe
                        [roleName] => CarbonCopy
                        [clientUserId] => 3
                        [RoutingOrder] => 3
                    )
            )
    )
) ]

Here's a list of what I tried to add Carbon Copies :

  1. I tried adding a 'carbonCopies' array at the same level as the 'templateRoles', failed.
  2. I tried to put 'carbonCopies' as a child of 'templateRoles', failed.
  3. I tried to create a CC in the template doc and assign a role name of 'Cc1' and then in the template role I added one recipient with roleName Cc1, it also failed.

Could you point me to the right direction on how to add a CarbonCopy doc to user without the recipient having to sign it?

Below are the reference pages I consulted on researching this: a. http://www.docusign.com/p/RESTAPIGuide/RESTAPIGuide.htm#REST%20API%20References/Recipients/Carbon%20Copies%20Recipient.htm?Highlight=CarbonCopy

b. __0">http://www.docusign.com/p/RESTAPIGuide/RESTAPIGuide.htm#REST%20API%20References/Recipient%20Parameter.htm%3FTocPath%3DREST%20API%20References|Send%20an%20Envelope%20or%20Create%20a%20Draft%20Envelope|Recipient%20Parameters|__0

Does any one have a complete php example on how to create an envelope with signers and carboncopies, using 'templateRoles' ?

Thanks

1
So when you say "it failed" what error message(s) are you receiving??Ergin
Error I received [errorCode] => INVALID_REQUEST_BODY[message] => The request body is missing or improperly formatted. Cannot deserialize the current JSON object (e.g. {"name":"value"}) into type 'System.Collections.Generic.List`1[API_REST.Models.v2.templateRole]' because the type requires a JSON array (e.g. [1,2,3]) to deserialize correctly.To fix this error either change the JSON to a JSON array (e.g. [1,2,3]) or change the deserialized type so that it is a normal .NET type (e.g. not a primitive type like integer, not a collection type like an array or List<T>) that can be deserialized...user2855591
@Ergin, with the current array the document is created, but not able to view it. When I cc'd recipient tries to view the document this is the error I receive. "errorCode": "RECIPIENT_NOT_IN_SEQUENCE", "message": "The token for an out of sequence recipient cannot be generated."user2855591

1 Answers

1
votes

I just tested and had no problem getting to work. Here's the steps I took and the request body I sent out. I was able to add Carbon Copy recipients two ways- 1) through use of templates with a CC role added 2) through a signature request on document (not using templates) where I add the CC recipient on the fly.

To use a template follow these steps:

  • Login to DocuSign Console and create a Template with 2 signing roles and 1 CC role.
  • Name the roles "Signer", "Signer2", and "CarbonCopy" respectively and save.
  • Create an envelope through the API using the following JSON request body:

(Make sure to enter values specific to your account)

{
    "accountId": "221765",
    "emailSubject": "Carbon Copy Testing",
    "emailBlurb": "This comes from PHP",
    "templateId": "7D5CF173-3EA5-******************",
    "templateRoles": [
        {
            "email": "[email protected]",
            "name": "John Doe",
            "roleName": "Signer"
        },
        {
            "email": "[email protected]",
            "name": "Jane Doe",
            "roleName": "Signer2"
        },
        {
            "email": "[email protected]",
            "name": "Bob Doe",
            "roleName": "CarbonCopy"
        }
    ],
    "status": "sent"
}

On the other hand, if you want to add a signer and a carbon copy recipient WITHOUT the use of Templates, you can use the following JSON request body:

{
"emailBlurb": "This comes from PHP",
"emailSubject": "API Signature Request",
"documents": [
    {
        "documentId": "1",
        "name": "document.pdf"
    }
],
"recipients": {
    "signers": [
        {
            "email": "[email protected]",
            "name": "John Doe",
            "recipientId": "1",
            "tabs": {
                "signHereTabs": [
                    {
                        "xPosition": "100",
                        "yPosition": "100",
                        "documentId": "1",
                        "pageNumber": "1"
                    }
                ]
            }
        }
    ],
    "carbonCopies": [
        {
            "email": "[email protected]",
            "name": "Jane Doe",
            "recipientId": "2"
        }
    ]
},
"status": "sent"
}

For examples of creating/sending envelopes from Templates see DocuSign API Walkthrough #1: http://iodocs.docusign.com/APIWalkthrough/requestSignatureFromTemplate

For examples of creating/sending envelopes from a Document see DocuSign API Walkthrough #4: http://iodocs.docusign.com/APIWalkthrough/requestSignatureFromDocument