0
votes

I am attempting to add recipients to a draft envelope that was created from a Template that uses to roles ('AlliancesDirectoy' & 'Partner'). Both Roles are in routing order 1 for clarity but that shouldn't matter.

After creating the envelope we can see the draft envelope has been created with two defined roles.

enter image description here

Now i attempt to add a recipient to my role 'AlliancesDirector'.

{
    "signers": [
    {
      "email": "[email protected]",
      "Name": "Mike",
      "RecipientId": 1,
      "RoleName": "AlliancesDirector",
    }
  ]
}

Which results in the following response: enter image description here

If i then look at the recipients that are already added to the envelope id see the following: enter image description here

Naturally this leads me to believe it doesn't like when i try to add a recipient using the already in use recipientId of '1'. If I change the recipientId to 5, for example, it adds my recipient in addition to the role. I don't want to add in addition to the role, i want to put a user into the pre-defined role.

Hope this more detailed explanation of what i'm trying to accomplish helps.

2
It doesn't look like you are passing valid JSON with the extra comma in "RoleName": "AlliancesDirector",. You're also not using regular cammelCase... it should be roleName, recipientId, etc. And what URL and method are you using for each of the 2 calls? - Ergin
You should also include the request body you're using when you create the envelope from the template in the first place. - Ergin
The more I think about this the problem must be with how you are creating the envelope from a template. Do you assign the recipients to the roles at that point? What's your JSON look like for that call?? - Ergin

2 Answers

1
votes

Took me some time to crack this but was finally able to reproduce your error and I believe I know what you're doing wrong. In line with my questions about the details of the 2nd API call you are making, you need to do a Recipient Correction to assign the recipient to a given template role, and I was getting the same error you were when I was mistakenly using the POST method and think you are doing the same.

Change your 2nd call from a POST to a PUT and it should work. I've verified in my testing that this is working as expected.

1
votes

This would be to add a recipient to a template upon creation of the envelope.

{
    "emailSubject": "StackOverflow Test",
    "status": "created",
    "templateId": "63611019-753f-41c2-b9fe-6aab8ea26387",
    "templateRoles": [
        {
            "email": "[email protected]",
            "name": "Stack Overflow",
            "roleName": "Leet Person"
        }
    ]
}

This would be to add a recipient to an existing envelope (regardless on if it's a template or not):

{
    "signers": [
        {
            "name": "Stack Overflow",
            "email": "[email protected]",
            "roleName": "Leet Person",
            "recipientId": 1
        }
    ]
}

As always please refer to the documentation Here for specific guidance with calls.

Modify or Correct and Resend Recipient Information

This lets you modify recipients in a draft envelope or correct recipient information for an in process envelope.

For draft envelopes, you can edit: email, userName, routingOrder, faxNumber, deliveryMethod, accessCode and requireIdLookup.


Note: If you send information for a recipient that does not already exist in a draft envelope, the recipient will be added to the envelope (similar to the POST).


Once an envelope has been sent, you can only edit: email, userName, signerName, routingOrder, faxNumber, and deliveryMethod. You can also select to resend an envelope by using the resend_envelope option.

URL:

/accounts/{accountId}/envelopes/{envelopeId}/recipients

Optional addition: resend_envelope {true or false}