asingla | Posts: 19

Year in Date Field

0 votes
Is it possible to break down the date into Year, Month and Date into 3 different columns using REST APIs?

Duo_Liang | Posts: 3776

Reply to: Year in Date Field

0 votes
Hi asingla, I am afraid we don't have a direct API call for retrieving date field value. But you can build this capability in your own system. First, you can use following call to retrieve the approval info where your date field is binding to:
GET /api/packages/{packageId}/documents/{documentId}/approvals/{approvalId}
The response payload could look like this:
{
    "role": "66da473d-3717-4ff7-bf85-f7f134e73be4",
    "id": "BYT22iCrsCYD",
    "optional": false,
    "accepted": "2018-07-10T14:47:58Z",
    "signed": "2018-07-10T14:47:59Z",
    "data": null,
    "fields": [
        {
            "binding": "{approval.signed}",
            "validation": null,
            "id": "TCb173e6x08A",
            "page": 0,
            "subtype": "LABEL",
            "height": 37,
            "width": 165,
            "left": 458,
            "top": 287,
            "extract": false,
            "extractAnchor": null,
            "data": null,
            "type": "INPUT",
            "value": "yyyy-MM-dd HH:mm:ss 'GMT'",
            "name": ""
        },
        {
            "binding": null,
            "validation": null,
            "id": "k1VrxYhqUm0Q",
            "page": 0,
            "subtype": "FULLNAME",
            "height": 37,
            "width": 165,
            "left": 161,
            "top": 287,
            "extract": false,
            "extractAnchor": null,
            "data": null,
            "type": "SIGNATURE",
            "value": "",
            "name": ""
        }
    ],
    "name": ""
}
As you noticed, the "accepted" attribute is the date stamp shown on the document.( not signed attribute) Then you can deal with the String with the programming language your system is using to retrieve the Year/Month/Date. Hope this reply could help you!

asingla | Posts: 19

Reply to: Year in Date Field

0 votes
Hi Duo, Let me put my question again. What I want is while doing signature, signature date field is populated automatically. Is it possible that instead of date in format ' yyyy-MM-dd HH:mm:ss 'GMT'' in single field. We can have year, month and date populated in 3 different fields?

Duo_Liang | Posts: 3776

Reply to: Year in Date Field

0 votes
Hi singla, Sorry for missing your point. If you want to have three fields and after the signature approval is finished, the date would inject into the three fields automatically instead of the original timestamp, I am afraid we don't have this feature so far. What you can do is modify the time format. You can send an email to [email protected], with the request and the format you want. Hope you find this reply helpful!

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