ksharlandjiev | Posts: 14

Missing fields

0 votes
Hello all, Thank you for the good forum, and your help here! I'm trying to integrate our systems with you, and I'm sending a JSON object trying to clone a template with 1 pdf document inside, but by some reason all the fields are not listed. First thing I've noticed is that when you create the package via your website using the designer, I've noticed that in "approvals" the name field is identical with the signature field ID, and I thought that's it! But unfortunately it didn't worked! I'm sure I'm missing something and I do hope you can point me the light! So here are some details: I'm testing on your sandbox server: sandbox.esignlive.com Trying to clone template with ID: jzEAvMZJFi0v4egwfRiQwJEbVlQ= I'm sending the following headers: Content-Type: application/json; Accept: application/json; esl-api-version=10.7 + the authentication of course! And the following JSON: {"language":"en","type":"PACKAGE","autocomplete":"true","visibility":"SENDER","notarized":"false","status":"DRAFT","name":"Booking XXXX / 20/02/2016 for 7nights","roles":[{"id":"33DC3891-521A-4429-9414-99915B91E919","reassign":"false","locked":"false","type":"SIGNER","name":"Mr James Smith","signers":[{"title":"Mr","firstName":"James","lastName":"Smith","email":"[email protected]","emailMessage":"Dear James,\nThank you for booking your respite break with us.\nEnclosed to this email, you will find your booking form for you to sign.","delivery":{"email":"true","download":"true","provider":"false"}}]},{"id":"8EAF36EF-CF81-4E3A-920F-FCF633F73F0A","reassign":"false","locked":"false","type":"SIGNER","name":"Mrs Helen Smith","signers":[{"title":"Mrs","firstName":"Helen","lastName":"Smith","email":"[email protected]","emailMessage":"Dear Helen,\nThank you for booking your respite break with us.\nEnclosed to this email, you will find your booking form for you to sign.","delivery":{"email":"true","download":"true","provider":"false"}}]}],"settings":{"ceremony":{"inPerson":"false"}},"documents":[{"name":"Booking Form","id":"a556d793d6481ffa","approvals":[{"role":"33DC3891-521A-4429-9414-99915B91E919","name":"iiBzSrwbziQW","fields":[{"name":"iiBzSrwbziQW","type":"SIGNATURE","subtype":"FULLNAME","page":"2","left":"77.277458190918","top":"887.181091308594","width":"305.518188476563","height":"37.3937187194824"},{"name":"lbl_sign_date","type":"INPUT","subtype":"LABEL","binding":"{approval.signed}","page":"2","left":"947.415283203125","top":"75.9303970336914","width":"305.272491455078","height":"35.0258979797363","value":"yyyy-MM-dd HH:mm:ss 'GMT'"},{"name":"lbl_date","type":"INPUT","subtype":"LABEL","page":"0","left":"434.333892822266","top":"122.22339630127","width":"260.122192382813","height":"36.9853897094727","value":"20Feb16"},{"name":"lbl_bookno","type":"INPUT","subtype":"LABEL","page":"0","left":"193.84","top":"275.1658","width":"494.28","height":"27","value":"Booking XXXX / 20/02/2016 for 7nights"},{"name":"lbl_aline1","type":"INPUT","subtype":"LABEL","page":"0","left":"96.566","top":"112.466","width":"263.16","height":"133","value":"Mr James Smith"},{"name":"lbl_aline2","type":"INPUT","subtype":"LABEL","page":"0","left":"96.566","top":"247.466","width":"263.16","height":"133","value":"XXXXXX"},{"name":"lbl_aline3","type":"INPUT","subtype":"LABEL","page":"0","left":"96.566","top":"382.466","width":"263.16","height":"133","value":"XXXXXXX"},{"name":"lbl_aline4","type":"INPUT","subtype":"LABEL","page":"0","left":"96.566","top":"517.466","width":"263.16","height":"133","value":"XXXXXX"},{"name":"lbl_aline55","type":"INPUT","subtype":"LABEL","page":"0","left":"96.566","top":"517.466","width":"263.16","height":"133"},{"name":"lbl_zip","type":"INPUT","subtype":"LABEL","page":"0","left":"96.566","top":"652.466","width":"263.16","height":"133","value":"XXX XXX"},{"name":"txt_catering_notes","type":"INPUT","subtype":"TEXTFIELD","page":"0","left":"402.145874023438","top":"885.916137695313","width":"290.495391845703","height":"43.4150543212891","value":"20Feb16"}]},{"role":"8EAF36EF-CF81-4E3A-920F-FCF633F73F0A","name":"hCVwzBANoBJE","fields":[{"name":"hCVwzBANoBJE","type":"SIGNATURE","subtype":"FULLNAME","page":"2","left":"77.277458190918","top":"887.181091308594","width":"305.518188476563","height":"37.3937187194824"},{"name":"lbl_sign_date","type":"INPUT","subtype":"LABEL","binding":"{approval.signed}","page":"2","left":"947.415283203125","top":"75.9303970336914","width":"305.272491455078","height":"35.0258979797363","value":"yyyy-MM-dd HH:mm:ss 'GMT'"},{"name":"lbl_date","type":"INPUT","subtype":"LABEL","page":"0","left":"434.333892822266","top":"122.22339630127","width":"260.122192382813","height":"36.9853897094727","value":"20Feb16"},{"name":"lbl_bookno","type":"INPUT","subtype":"LABEL","page":"0","left":"193.84","top":"275.1658","width":"494.28","height":"27","value":"Booking XXXX / 20/02/2016 for 7nights"},{"name":"lbl_aline1","type":"INPUT","subtype":"LABEL","page":"0","left":"96.566","top":"112.466","width":"263.16","height":"133","value":"Mrs Helen Smith"},{"name":"lbl_aline2","type":"INPUT","subtype":"LABEL","page":"0","left":"96.566","top":"247.466","width":"263.16","height":"133","value":"XXXXXXX"},{"name":"lbl_aline3","type":"INPUT","subtype":"LABEL","page":"0","left":"96.566","top":"382.466","width":"263.16","height":"133","value":"XXXXX"},{"name":"lbl_aline4","type":"INPUT","subtype":"LABEL","page":"0","left":"96.566","top":"517.466","width":"263.16","height":"133","value":"XXXXX"},{"name":"lbl_aline55","type":"INPUT","subtype":"LABEL","page":"0","left":"96.566","top":"517.466","width":"263.16","height":"133"},{"name":"lbl_zip","type":"INPUT","subtype":"LABEL","page":"0","left":"96.566","top":"652.466","width":"263.16","height":"133","value":"XXX XXX"},{"name":"txt_catering_notes","type":"INPUT","subtype":"TEXTFIELD","page":"0","left":"402.145874023438","top":"885.916137695313","width":"290.495391845703","height":"43.4150543212891","value":"20Feb16"}]}]}]} I'm getting an ID as a return, and I can see the transaction in DRAFTS, but when I enter the details : 1) I see that you system is automatically adding me as OWNER - which is fine I guess. 2) All fields are missing, and looking at firebug and the result of requesting this transaction details, there are no approvals inside "documents" object at all. So by some reason your system is not accepting or deleting the approvals, and I have no idea why. I've made a manual transaction with 2 recipients, and a couple of fields, ID: W-BKP_qULyHovPS8Z4vK6ynx6Uo= and I'm trying to produce the same json (see above) and send it to your API but its not working :) Please HELP! :) Thank you in advance! Kamen

Approved Answer
harishaidary | Posts: 1812

Reply to: Missing fields

0 votes
You will have to do it in two calls unfortunately. Cloning a template is intended to be used with placeholders, as I mentioned in my previous reply (it will ignore the approvals object in the json payload). Let me know if you have any other questions :) Edit: and yes, you will have to make a 3rd request to
https://sandbox.esignlive.com/api/packages/{packageId}
With the following json payload:
{
  "status": "SENT"
}

harishaidary | Posts: 1812

Reply to: Missing fields

0 votes
Hey Kamen, If I understand correctly, your workflow is the following:
  1. create a template through the web portal with one document and no approvals
  2. create a package from your template and adding approvals in one call
Is that what you are looking to do? Let me know :)

ksharlandjiev | Posts: 14

Reply to: Missing fields

0 votes
Hello and thank you for your prompt answer! Yes, we have a blank pdf form, which I want to save as template, and then add all approvals and signatures in one call, cloning this template. Thanks.

harishaidary | Posts: 1812

Reply to: Missing fields

0 votes
Let me look into this and I will get back to you shortly. I ran a quick test and I've been getting the same result as you (approvals not showing up after cloning package). I'll let you know what I find out.

ksharlandjiev | Posts: 14

Reply to: Missing fields

0 votes
Thanks! You are a star. Kamen

harishaidary | Posts: 1812

Reply to: Missing fields

0 votes
No worries. I had a closer look at your template you're trying to create a package from and it seems that there is only a document in it with no placeholders or signers. A first, I thought you had placeholders and such to replace but since there are none, there is no real need to create a template. You could simply directly create your package in one call by making your POST request to:
https://sandbox.esignlive.com/api/packages
Your approvals should appear then. You can have a look a look at this quick start guide on how to create and send a package in one call with the REST API: https://developer.esignlive.com/guides/quick-start/creating-and-sending-a-package-rest/ Let me know if you have any other questions :)

ksharlandjiev | Posts: 14

Reply to: Missing fields

0 votes
Hi Haris, Thanks again! Well in the beginning my template had 2 recipients, but it was the same. I then deleted them during the tests when I was trying to make this working. As for creating the package from scratch, I would prefer not to upload the same blank document every time. Let me try to add 1 recipient in my template and see if this is going to make any difference.

ksharlandjiev | Posts: 14

Reply to: Missing fields

0 votes
Same result I'm afraid: ID: ywZpiS9_nmzwy-nsljYzbBenVH0= I now have a lot of signers, but "approvals" is empty. Any idea what may cause this? Also, when cloning a template and passing new JSON with roles and approvals, is your system performing "merge" or it is applying the new JSON? How can I clone a template and get rid of the old recipients? Thank you for your assistance. Kamen

harishaidary | Posts: 1812

Reply to: Missing fields

0 votes
Ah I think see now what you are trying to do. In your template, you can add placeholders instead of recipients and place the signatures and fields accordingly on your documents. Then, when creating a package from your template, you can replace the placeholders with your signer information and eSignLive will automatically populate all the signatures and fields. Now, the only trouble is, because you adding placeholders through the UI, you will have to retrieve the id of these placeholders first and replace them in the role id when cloning your template (eSignLive assigns randomly generated ids when creating through the UI). I can get your a working example if this is what you are looking to do. If you don't want to use placeholders, then you could first clone your template without the approvals object in your JSON payload as shown below:
{
  "language": "en",
  "type": "PACKAGE",
  "autocomplete": "true",
  "visibility": "SENDER",
  "notarized": "false",
  "status": "DRAFT",
  "name": "Booking XXXX / 20/02/2016 for 7nights",
  "roles": [
    {
      "id": "33DC3891-521A-4429-9414-99915B91E919",
      "reassign": "false",
      "locked": "false",
      "type": "SIGNER",
      "name": "Mr James Smith",
      "signers": [
        {
          "title": "Mr",
          "firstName": "James",
          "lastName": "Smith",
          "email": "[email protected]",
          "emailMessage": "Dear James,\nThank you for booking your respite break with us.\nEnclosed to this email, you will find your booking form for you to sign.",
          "delivery": {
            "email": "true",
            "download": "true",
            "provider": "false"
          }
        }
      ]
    },
    {
      "id": "8EAF36EF-CF81-4E3A-920F-FCF633F73F0A",
      "reassign": "false",
      "locked": "false",
      "type": "SIGNER",
      "name": "Mrs Helen Smith",
      "signers": [
        {
          "title": "Mrs",
          "firstName": "Helen",
          "lastName": "Smith",
          "email": "[email protected]",
          "emailMessage": "Dear Helen,\nThank you for booking your respite break with us.\nEnclosed to this email, you will find your booking form for you to sign.",
          "delivery": {
            "email": "true",
            "download": "true",
            "provider": "false"
          }
        }
      ]
    }
  ],
  "settings": {
    "ceremony": {
      "inPerson": "false"
    }
  }
} 
Then, you make a second call to eSignLive to add all your approvals. You will need to make a PUT request to
https://sandbox.esignlive.com/api/packages/{packageId}/documents/{documentId}/approvals 
with the following payload:
[
  {
    "role": "33DC3891-521A-4429-9414-99915B91E919",
    "name": "iiBzSrwbziQW",
    "fields": [
      {
        "name": "iiBzSrwbziQW",
        "type": "SIGNATURE",
        "subtype": "FULLNAME",
        "page": "2",
        "left": "77.277458190918",
        "top": "887.181091308594",
        "width": "305.518188476563",
        "height": "37.3937187194824"
      },
      {
        "name": "lbl_sign_date",
        "type": "INPUT",
        "subtype": "LABEL",
        "binding": "{approval.signed}",
        "page": "2",
        "left": "947.415283203125",
        "top": "75.9303970336914",
        "width": "305.272491455078",
        "height": "35.0258979797363",
        "value": "yyyy-MM-dd HH:mm:ss ‘GMT'"
      },
      {
        "name": "lbl_date",
        "type": "INPUT",
        "subtype": "LABEL",
        "page": "0",
        "left": "434.333892822266",
        "top": "122.22339630127",
        "width": "260.122192382813",
        "height": "36.9853897094727",
        "value": "20Feb16"
      },
      {
        "name": "lbl_bookno",
        "type": "INPUT",
        "subtype": "LABEL",
        "page": "0",
        "left": "193.84",
        "top": "275.1658",
        "width": "494.28",
        "height": "27",
        "value": "Booking XXXX / 20/02/2016 for 7nights"
      },
      {
        "name": "lbl_aline1",
        "type": "INPUT",
        "subtype": "LABEL",
        "page": "0",
        "left": "96.566",
        "top": "112.466",
        "width": "263.16",
        "height": "133",
        "value": "Mr James Smith"
      },
      {
        "name": "lbl_aline2",
        "type": "INPUT",
        "subtype": "LABEL",
        "page": "0",
        "left": "96.566",
        "top": "247.466",
        "width": "263.16",
        "height": "133",
        "value": "XXXXXX"
      },
      {
        "name": "lbl_aline3",
        "type": "INPUT",
        "subtype": "LABEL",
        "page": "0",
        "left": "96.566",
        "top": "382.466",
        "width": "263.16",
        "height": "133",
        "value": "XXXXXXX"
      },
      {
        "name": "lbl_aline4",
        "type": "INPUT",
        "subtype": "LABEL",
        "page": "0",
        "left": "96.566",
        "top": "517.466",
        "width": "263.16",
        "height": "133",
        "value": "XXXXXX"
      },
      {
        "name": "lbl_aline55",
        "type": "INPUT",
        "subtype": "LABEL",
        "page": "0",
        "left": "96.566",
        "top": "517.466",
        "width": "263.16",
        "height": "133"
      },
      {
        "name": "lbl_zip",
        "type": "INPUT",
        "subtype": "LABEL",
        "page": "0",
        "left": "96.566",
        "top": "652.466",
        "width": "263.16",
        "height": "133",
        "value": "XXX XXX"
      },
      {
        "name": "txt_catering_notes",
        "type": "INPUT",
        "subtype": "TEXTFIELD",
        "page": "0",
        "left": "402.145874023438",
        "top": "885.916137695313",
        "width": "290.495391845703",
        "height": "43.4150543212891",
        "value": "20Feb16"
      }
    ]
  },
  {
    "role": "8EAF36EF-CF81-4E3A-920F-FCF633F73F0A",
    "name": "hCVwzBANoBJE",
    "fields": [
      {
        "name": "hCVwzBANoBJE",
        "type": "SIGNATURE",
        "subtype": "FULLNAME",
        "page": "2",
        "left": "77.277458190918",
        "top": "887.181091308594",
        "width": "305.518188476563",
        "height": "37.3937187194824"
      },
      {
        "name": "lbl_sign_date",
        "type": "INPUT",
        "subtype": "LABEL",
        "binding": "{approval.signed}",
        "page": "2",
        "left": "947.415283203125",
        "top": "75.9303970336914",
        "width": "305.272491455078",
        "height": "35.0258979797363",
        "value": "yyyy-MM-dd HH:mm:ss ‘GMT'"
      },
      {
        "name": "lbl_date",
        "type": "INPUT",
        "subtype": "LABEL",
        "page": "0",
        "left": "434.333892822266",
        "top": "122.22339630127",
        "width": "260.122192382813",
        "height": "36.9853897094727",
        "value": "20Feb16"
      },
      {
        "name": "lbl_bookno",
        "type": "INPUT",
        "subtype": "LABEL",
        "page": "0",
        "left": "193.84",
        "top": "275.1658",
        "width": "494.28",
        "height": "27",
        "value": "Booking XXXX / 20/02/2016 for 7nights"
      },
      {
        "name": "lbl_aline1",
        "type": "INPUT",
        "subtype": "LABEL",
        "page": "0",
        "left": "96.566",
        "top": "112.466",
        "width": "263.16",
        "height": "133",
        "value": "Mrs Helen Smith"
      },
      {
        "name": "lbl_aline2",
        "type": "INPUT",
        "subtype": "LABEL",
        "page": "0",
        "left": "96.566",
        "top": "247.466",
        "width": "263.16",
        "height": "133",
        "value": "XXXXXXX"
      },
      {
        "name": "lbl_aline3",
        "type": "INPUT",
        "subtype": "LABEL",
        "page": "0",
        "left": "96.566",
        "top": "382.466",
        "width": "263.16",
        "height": "133",
        "value": "XXXXX"
      },
      {
        "name": "lbl_aline4",
        "type": "INPUT",
        "subtype": "LABEL",
        "page": "0",
        "left": "96.566",
        "top": "517.466",
        "width": "263.16",
        "height": "133",
        "value": "XXXXX"
      },
      {
        "name": "lbl_aline55",
        "type": "INPUT",
        "subtype": "LABEL",
        "page": "0",
        "left": "96.566",
        "top": "517.466",
        "width": "263.16",
        "height": "133"
      },
      {
        "name": "lbl_zip",
        "type": "INPUT",
        "subtype": "LABEL",
        "page": "0",
        "left": "96.566",
        "top": "652.466",
        "width": "263.16",
        "height": "133",
        "value": "XXX XXX"
      },
      {
        "name": "txt_catering_notes",
        "type": "INPUT",
        "subtype": "TEXTFIELD",
        "page": "0",
        "left": "402.145874023438",
        "top": "885.916137695313",
        "width": "290.495391845703",
        "height": "43.4150543212891",
        "value": "20Feb16"
      }
    ]
  }
]

ksharlandjiev | Posts: 14

Reply to: Missing fields

0 votes
You are a star! It is working. OK, so 2 new questions now: 1) Can I or not do the whole thing using 1 call only? 2) If I do it with 2 calls, then I suppose I'll need a 3rd one to trigger the email send? Once again, thank you for your help! Kamen

ksharlandjiev | Posts: 14

Reply to: Missing fields

0 votes
Thank you!

harishaidary | Posts: 1812

Reply to: Missing fields

0 votes
Pleasure :)

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