r-mikolajuk | Posts: 26

Updating emailMessage

0 votes
I've noticed that it is not possible to update emailMessage for chosen role. TC 1. User submits content and package is being created from the template using:
{
    "roles": [
        {
            "emailMessage": {
                "content": "List X"
            },
            "reassign": false,
            "id": "role-id",
            "type": "SIGNER",
            "signers": [
                {
                    "firstName": "First",
                    "lastName": "Last",
                    "name": "First Last",
                    "email": "[email protected]",
                    "language": "en",
                    "delivery": {
                        "email": true,
                        "provider": false,
                        "download": true
                    },
                    "id": "Signer"
                }
            ],
            "name": "Signer"
        }
    ]
}
2. Users creates new content - signature request needs to be updated:
{
    "emailMessage": "List X, Y",
    "roles": [
        {
            "emailMessage": {
                "content": "List X, Y"
            },
            "id": "role-id",
            "name": "Signer"
        }
    ]
}
Expected: Email for the Signer role contains: "List X, Y" Actual: Email for the Signer role contains: "List X" Only the main emailMessage (Message to all recipients) is updated.

Approved Answer
mwilliams | Posts: 957

Reply to: Updating emailMessage

0 votes
Okay. I tried it out the other way and I'm seeing the same as you. I believe this would mean that only package level attributes are updated by the PUT call on the package URL. If you use the call I used in my first message, you'll be able to update the actual role email message.

mwilliams | Posts: 957

Reply to: Updating emailMessage

0 votes
I am able to update a signer's individual message with the following call, while the package is in DRAFT mode without issue. This is with a package message already set. PUT
https://sandbox.esignlive.com/a/api/packages/{packageId}/roles/{roleId}
Along with the updated Role JSON (probably only need the ID and the email message though):
{"id":"072a27f3-f310-4a79-9e15-2d8aded06e29","data":null,"emailMessage":{"content":"I have changed the individual email message"},"attachmentRequirements":[],"locked":false,"reassign":false,"specialTypes":[],"type":"SIGNER","index":0,"signers":[{"created":"2017-02-09T20:04:49Z","group":null,"language":"en","signature":null,"id":"7f7640dd-70be-478c-946e-ed23df098d21","auth":{"scheme":"NONE","challenges":[]},"knowledgeBasedAuthentication":null,"delivery":{"provider":false,"email":false,"download":false},"title":"","data":null,"updated":"2017-02-09T20:04:48Z","external":null,"company":"eSignLive by VASCO","email":"[email protected]","firstName":"MWilliams","lastName":"Silanis","phone":"","professionalIdentityFields":[],"userCustomFields":[],"address":null,"name":"","specialTypes":[]}],"name":"Signer1"}

mwilliams | Posts: 957

Reply to: Updating emailMessage

0 votes
Though, I guess since you're adding a package message at the same time you're updating the role message that you're making a PUT call to just the Package with updated JSON?

r-mikolajuk | Posts: 26

Reply to: Updating emailMessage

0 votes
Thank you Michael Indeed I was trying to update package with the roles at once. Using dedicated role endpoint API works better. But there is one issue - data is not merged but replaced with the defaults. In my case, there is only one signer so I'll go with other option - not setting emailMessage for Signer role at all, then update it on package level. That works just fine (for my case). Note about using
https://sandbox.esignlive.com/a/api/packages/{packageId}/roles/{roleId}
So I have a package (DRAFT), with Signer role:
{
  /* ... */
  "roles": [
    {
      /* ... */
      "type": "SENDER"
    },
    {
      "attachmentRequirements": [],
      "data": null,
      "emailMessage": {
        "content": "Hi Robert!"
      },
      "id": "e9536976-ca09-49e8-8eb3-13cc765bcbf6",
      "index": 0,
      "locked": false,
      "name": "Signer",
      "reassign": false,
      "signers": [
        {
          "address": null,
          "auth": {
            "challenges": [],
            "scheme": "NONE"
          },
          "company": "",
          "created": "2016-12-21T15:03:04Z",
          "data": null,
          "delivery": {
            "download": true,
            "email": true,
            "provider": false
          },
          "email": "[email protected]",
          "external": null,
          "firstName": "Robert",
          "group": null,
          "id": "Signer",
          "knowledgeBasedAuthentication": null,
          "language": "en",
          "lastName": "Last",
          "name": "",
          "phone": "",
          "professionalIdentityFields": [],
          "signature": null,
          "specialTypes": [],
          "title": "",
          "updated": "2016-12-21T15:03:04Z",
          "userCustomFields": []
        }
      ],
      "specialTypes": [],
      "type": "SIGNER"
    }
  ]
  /* ... */
}
Updating only the emailMessage content:
PUT /api/packages/2c8mpMd5QVm_ZYN6czx1ChzyJHE=/roles/e9536976-ca09-49e8-8eb3-13cc765bcbf6

{
    "emailMessage": {
        "content": "Signer only"
    }, 
    "id": "e9536976-ca09-49e8-8eb3-13cc765bcbf6"
}
Response I get (look at the fields list):
HTTP/1.1 200 OK
Cache-control: no-store, no-cache, must-revalidate
Connection: keep-alive
Content-Type: application/json
Date: Fri, 10 Feb 2017 08:02:36 GMT
Expires: Thu, 01 Jan 1970 00:00:00 GMT
P3P: CP="IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT"
Server: nginx
Transfer-Encoding: chunked
X-Powered-By: Undertow

{
    "attachmentRequirements": [], 
    "data": null, 
    "emailMessage": {
        "content": "Signer only"
    }, 
    "id": "e9536976-ca09-49e8-8eb3-13cc765bcbf6", 
    "index": 0, 
    "locked": false, 
    "name": "Signer1", 
    "reassign": false, 
    "signers": [], 
    "specialTypes": [], 
    "type": "SIGNER"
}
Get the package data:
{
  /* ... */
  "roles": [
    {
      /* ... */
      "type": "SENDER"
    },
    {
      "attachmentRequirements": [],
      "data": null,
      "emailMessage": {
        "content": "Signer only"
      },
      "id": "e9536976-ca09-49e8-8eb3-13cc765bcbf6",
      "index": 0,
      "locked": false,
      "name": "Signer1",
      "reassign": false,
      "signers": [],
      "specialTypes": [],
      "type": "SIGNER"
    }
  ],
  /* ... */
}
Result: trying to update only the emailMessage content I'm loosing signer data. Which, IMHO shouldn't work this way - it should work as it does on package level, where I can pass only that JSON:
{
    "emailMessage": "Just it"
}

Hello! Looks like you're enjoying the discussion, but haven't signed up for an account.

When you create an account, we remember exactly what you've read, so you always come right back where you left off