gtawaf | Posts: 12

Create Package and all Sub classes needed in one call.

0 votes
Hello, I'm trying to create a package with all of it dependencies and documents at once: if I try a payload as
 {
        "documents":[
            {
                "approvals":[
                    {
                        "id":"Signature1",
                        "role":"Role1",
                        "fields":[
                            {
                                "page":0,
                                "top":800,
                                "subtype":"FULLNAME",
                                "optional":true,
                                "height":50,
                                "left":300,
                                "width":200,
                                "type":"SIGNATURE",
                                "name":"ExampleSignature"
                            },
                            {
                                "binding": "{signer.email}",
                                "validation": nil,
                                "page": 0,
                                "data": nil,
                                "subtype": "LABEL",
                                "top": 700,
                                "height": 30,
                                "extractAnchor": nil,
                                "width": 100,
                                "extract": false,
                                "left": 300,
                                "type": "INPUT",
                                "name": "Signer Email"
                            }
                        ],
                        "name":""
                    },
                    {
                        "id":"Signature2",
                        "role":"Role2",
                        "fields":[
                            {
                                "page":0,
                                "top":850,
                                "subtype":"FULLNAME",
                                "optional":true,
                                "height":50,
                                "left":300,
                                "width":200,
                                "type":"SIGNATURE",
                                "name":"ExampleSignature"
                            },
                            {
                                "binding": "{signer.title}",
                                "validation": nil,
                                "page": 0,
                                "data": nil,
                                "subtype": "LABEL",
                                "top": 750,
                                "height": 30,
                                "extractAnchor": nil,
                                "width": 100,
                                "extract": false,
                                "left": 300,
                                "type": "INPUT",
                                "name": "Signer Email"
                            }
                        ],
                        "name":""
                    }
                ],
                "id":"document1",
                "name":"Test Document1"
            }
        ],
        "roles":[
            {
                "id":"Role1",
                "type":"SIGNER",
                "signers":[
                    {
                        "id":"Signer1",
                        title: "role 1",
                        "email":"[email protected]",
                        "firstName":"1.firstname",
                        "lastName":"1.lastname"
                    }
                ],
                "name":"Role1"
            },
            {
                "id":"Role2",
                "type":"SIGNER",
                "signers":[
                    {
                        "id":"Signer2",
                        title: "rol2",
                        "email":"[email protected]",
                        "firstName":"2.firstname",
                        "lastName":"2.lastname"
                    }
                ],
                "name":"Role2"
            }
        ],
        "settings":{
            "ceremony":{
                "inPerson": false,
                "declineButton": false,
                disableDownloadForUncompletedPackage: true,
                hideLanguageDropdown: true,
                "hideWatermark":true,
                "optOutButton":false,
                disableOptOutOther: false,
                handOver: {link: 'https://localhost:3000.info'},
                "layout": {
                    "brandingBar": nil,
                    "footer": nil,
                    "header": nil,
                    titleBar: nil,
                    "navigator": false,
                    "iframe": true
                },
            }
        },
        "status":"SENT",
        "type":"PACKAGE",
        language: "en",
        emailMessage: "",
        autocomplete: true,
        "name":"Example Package with multiple documents"
    }
It works but I do not want to override ids, so If I remove the ids and send payload as
 {
        "documents":[
            {
                "approvals":[
                    {
                        "role":"Role1",
                        "fields":[
                            {
                                "page":0,
                                "top":800,
                                "subtype":"FULLNAME",
                                "optional":true,
                                "height":50,
                                "left":300,
                                "width":200,
                                "type":"SIGNATURE",
                                "name":"ExampleSignature"
                            },
                            {
                                "binding": "{signer.email}",
                                "validation": nil,
                                "page": 0,
                                "data": nil,
                                "subtype": "LABEL",
                                "top": 700,
                                "height": 30,
                                "extractAnchor": nil,
                                "width": 100,
                                "extract": false,
                                "left": 300,
                                "type": "INPUT",
                                "name": "Signer Email"
                            }
                        ],
                        "name":""
                    },
                    {
                        "role":"Role2",
                        "fields":[
                            {
                                "page":0,
                                "top":850,
                                "subtype":"FULLNAME",
                                "optional":true,
                                "height":50,
                                "left":300,
                                "width":200,
                                "type":"SIGNATURE",
                                "name":"ExampleSignature"
                            },
                            {
                                "binding": "{signer.title}",
                                "validation": nil,
                                "page": 0,
                                "data": nil,
                                "subtype": "LABEL",
                                "top": 750,
                                "height": 30,
                                "extractAnchor": nil,
                                "width": 100,
                                "extract": false,
                                "left": 300,
                                "type": "INPUT",
                                "name": "Signer Email"
                            }
                        ],
                        "name":""
                    }
                ],
                "name":"Test Document1"
            }
        ],
        "roles":[
            {
                "type":"SIGNER",
                "signers":[
                    {
                        title: "role 1",
                        "email":"[email protected]",
                        "firstName":"1.firstname",
                        "lastName":"1.lastname"
                    }
                ],
                "name":"Role1"
            },
            {
                "type":"SIGNER",
                "signers":[
                    {
                        title: "rol2",
                        "email":"[email protected]",
                        "firstName":"2.firstname",
                        "lastName":"2.lastname"
                    }
                ],
                "name":"Role2"
            }
        ],
        "settings":{
            "ceremony":{
                "inPerson": false,
                "declineButton": false,
                disableDownloadForUncompletedPackage: true,
                hideLanguageDropdown: true,
                "hideWatermark":true,
                "optOutButton":false,
                disableOptOutOther: false,
                handOver: {link: 'https://localhost:3000.info'},
                "layout": {
                    "brandingBar": nil,
                    "footer": nil,
                    "header": nil,
                    titleBar: nil,
                    "navigator": false,
                    "iframe": true
                },
            }
        },
        "status":"SENT",
        "type":"PACKAGE",
        language: "en",
        emailMessage: "",
        autocomplete: true,
        "name":"Example Package with multiple documents"
    }
so does using the same id in multiple requests override them? if yes, how can I make the second json work? Thanks

Approved Answer
Duo_Liang | Posts: 3776

Reply to: Create Package and all Sub classes needed in one call.

0 votes
Hi gtawaf, I am not pretty sure I understand your issue and can you explain more about the reason why you don't to assign the IDs? Because if you don't assign an ID for documents/approvals/fields, OneSpan Sign would generate one for you which could make it more difficult for you to retrieve them. And if you just don't want to assign the IDs, there's one ID you can't remove, which is the "roleID". You'll need role ID to match your approval to let OneSpan Sign know which role is binded to the signature.
 "roles":[
            {
                "id":"Role1",
                "type":"SIGNER",
                "signers":[
                    {
                        "title": "role 1",
                        "email":"[email protected]",
                        "firstName":"1.firstname",
                        "lastName":"1.lastname"
                    }
                ],
                "name":"Role1"
            },
            {
                "id":"Role2",
                "type":"SIGNER",
                "signers":[
                    {
                        "title": "rol2",
                        "email":"[email protected]",
                        "firstName":"2.firstname",
                        "lastName":"2.lastname"
                    }
                ],
                "name":"Role2"
            }
        ]
Hope this could help you! Duo

gtawaf | Posts: 12

Reply to: Create Package and all Sub classes needed in one call.

0 votes
Hello Duo, Thanks for the prompt reply. I'm just worried the ids would override other ids in your system. is that possible? Thanks

Duo_Liang | Posts: 3776

Reply to: Create Package and all Sub classes needed in one call.

0 votes
Hi gtawaf, Please don't worry about that, the ID is within the package level. Just feel free to assign the IDs you want as it's easier for you to locate the objects when you want to grab them. Duo

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