Skip to main content
Participant
June 2, 2023
解決済み

API default form fields issue

  • June 2, 2023
  • 返信数 1.
  • 628 ビュー
  1. In Swagger I do POST/transientDocuments and get transientDocumentId
  2. I use transientDocumentId in POST/agreements, I get agreementID
{
  "fileInfos": [
    {
      "transientDocumentId": "XXX"
    }
  ],
  "name": "XXX",
  "participantSetsInfo": [
    {
      "order": 1,
      "role": "SIGNER",
      "memberInfos": [
        {
          "email": "XXX"
        }
      ]
    }
  ],
  "signatureType": "ESIGN",
  "state": "AUTHORING"
}

3. I do PUT/agreements/XXX/formFields

{
  "fields": [
    {
      "locations": [
        {
          "pageNumber": 1,
          "top": 100,
          "left": 15,
          "width": 50,
          "height": 30
        }
      ],
      "inputType": "PDF_SIGNATURE",
      "contentType": "SIGNATURE",
      "name": "Field1",
      "required": "true",
      "visible": "true"
    },
    {
      "locations": [
        {
          "pageNumber": 1,
          "top": 150,
          "left": 15,
          "width": 50,
          "height": 30
        }
      ],
      "inputType": "TEXT_FIELD",
      "contentType": "SIGNATURE_DATE",
      "format": "DATE_DD_MM_YYYY",
      "name": "Field2",
      "required": "true",
      "visible": "true"
    }
  ]
}

 

PDF was sent, but my fields are not there. Default Signature&Email signature block is used.

 

However when I repeat steps 1,2,3 from above but starting with "state": "DRAFT" I can see with GET/agreements/XXX/formFields that my fields are there.

 

After moving to 

{
  "state": "IN_PROCESS"
}

my fields are not there, but default one is used again.

 

Why?

このトピックへの返信は締め切られました。
解決に役立った回答 Michal301295827jrq

Solved. So the thing is that you must provide assignee to your custom form fields. If you don't do that, default signature block is placed to the end of the document.

 

Assignee number is dynamic value so get it here GET /agreements/{agreementId}/members 

 

{
  "participantSets": [
    {
      "memberInfos": [
        {
          "id": "XXX",
          "email": "XXX",
          "self": false,
          "securityOption": {
            "authenticationMethod": "NONE"
          },
          "name": "XXX",
          "company": "XXX",
          "status": "ACTIVE",
          "createdDate": "2023-06-06T10:52:32Z",
          "userId": "XXX"
        }
      ],
      "id": "THIS IS ASSIGNEE NUMBER",
      "role": "SIGNER",
      "status": "NOT_YET_VISIBLE",
      "order": 1
    }
  ],
  "senderInfo": {
    "participantId": "XXX",
    "email": "XXX",
    "company": "XXX",
    "name": "XXX",
    "self": true,
    "hidden": false,
    "status": "WAITING_FOR_AUTHORING",
    "createdDate": "2023-06-06T10:52:32Z",
    "userId": "XXX"
  }
}

 

Correct order of steps is:

1. POST/transientDocuments

2. POST/agreements

3. GET /agreements/{agreementId}/members

4. PUT/agreements/{agreementId}/formFields

{
  "fields": [
    {
      "locations": [
        {
          "pageNumber": 1,
          "top": 125,
          "left": 400,
          "width": 200,
          "height": 20
        }
      ],
      "inputType": "SIGNATURE",
      "contentType": "SIGNATURE",
      "name": "Field1",
      "required": "true",
      "assignee": "XXX"
    }

 

返信数 1

Michal301295827jrq作成者解決!
Participant
June 7, 2023

Solved. So the thing is that you must provide assignee to your custom form fields. If you don't do that, default signature block is placed to the end of the document.

 

Assignee number is dynamic value so get it here GET /agreements/{agreementId}/members 

 

{
  "participantSets": [
    {
      "memberInfos": [
        {
          "id": "XXX",
          "email": "XXX",
          "self": false,
          "securityOption": {
            "authenticationMethod": "NONE"
          },
          "name": "XXX",
          "company": "XXX",
          "status": "ACTIVE",
          "createdDate": "2023-06-06T10:52:32Z",
          "userId": "XXX"
        }
      ],
      "id": "THIS IS ASSIGNEE NUMBER",
      "role": "SIGNER",
      "status": "NOT_YET_VISIBLE",
      "order": 1
    }
  ],
  "senderInfo": {
    "participantId": "XXX",
    "email": "XXX",
    "company": "XXX",
    "name": "XXX",
    "self": true,
    "hidden": false,
    "status": "WAITING_FOR_AUTHORING",
    "createdDate": "2023-06-06T10:52:32Z",
    "userId": "XXX"
  }
}

 

Correct order of steps is:

1. POST/transientDocuments

2. POST/agreements

3. GET /agreements/{agreementId}/members

4. PUT/agreements/{agreementId}/formFields

{
  "fields": [
    {
      "locations": [
        {
          "pageNumber": 1,
          "top": 125,
          "left": 400,
          "width": 200,
          "height": 20
        }
      ],
      "inputType": "SIGNATURE",
      "contentType": "SIGNATURE",
      "name": "Field1",
      "required": "true",
      "assignee": "XXX"
    }