(Enterprise) signorder... subject part does not work

Question:

When I try the signOrder below in postman, I got the following error

{
“instance”: “/sign/orders”,
“method”: “POST”,
“status”: 400,
“type”: “base:json-mismatched-input-problem”,
“title”: “JSON mismatched input problem”,
“detail”: “Could not bind ‘$.subject’. Only known properties at this level are [clientReference, businessLookupTasks, daysUntilDeletion, notifications, packagingTasks, tasks].”
}

It does seam that the subject part is implemented in the signorder…?


operation : {{host}}/sign/orders
{
“clientReference”: “213412431234123”,
“tasks”: [
{
“profile” : “default”,
“daysToLive”: 7,
“language”: “da”,
“id”: “task-id”,
“documents”: [
{
“action”: “SIGN”,
“description”: “Sign”,
“documentRef”: “{{document_id}}”,
“id”: “doc-id”,
“source”: “SESSION”,
“signTextEntry”: “NEMID window text… Does work either”,
“sendResultToArchive” : false
}
],
“signatureMethods”: [
{
“name”: “nemid-sign”,
“type”: “SIGNED_STATEMENT”
},
{
“name”: “mitid-sign”,
“type”: “SIGNED_STATEMENT”
}

        ],
        "onTaskComplete": "https://en.wikipedia.org/wiki/Completeness",
        "onTaskReject": "https://en.wikipedia.org/wiki/Cancel",
        "notifications": [
            {
                "id": "callback-notification",
                "recipient": "https://en.wikipedia.org/wiki/Cancel",
                "schedule": [
                    {
                        "triggerStatus": "COMPLETED"
                    }
                ],
                "type": "URL"
            }
        ]
    }
],
"subject": {
    "id": "subject-id",
    "attributes": [
      {
        "name": "national-id",
        "value": "10109001290",  
        "methods": [
           "nemid-sign",
           "mitid-sign"
        ]
      }
    ]
},
"daysUntilDeletion" : 14,
"packagingTasks": [
    {
        "id": "packaging-task-id",
        "sendToArchive": true,
        "method": "pades",
        "documents": [
            {
                "taskId": "task-id",
                "documentIds": [
                    "doc-id"
                ]
            }
        ]
    }
]

}

Answer:

It was an error-40… The JSON structure was wrong from my side… :slight_smile:

Fixing the Structure generates this error

{
“instance”: “/sign/orders”,
“method”: “POST”,
“status”: 500,
“type”: “base:server-problem”,
“title”: “Internal Server Error”
}


for this payload
{
“clientReference”: “213412431234123”,
“tasks”: [
{
“profile” : “default”,
“daysToLive”: 7,
“language”: “da”,
“id”: “task-id”,
“signText”: “NEMID window text…”,
“documents”: [
{
“action”: “SIGN”,
“description”: “Betalingsserviceaftale”,
“documentRef”: “{{document_id}}”,
“id”: “doc-id”,
“source”: “SESSION”,
“sendResultToArchive” : false
}
],
“signatureMethods”: [
{
“name”: “nemid-sign”,
“type”: “SIGNED_STATEMENT”
},
{
“name”: “mitid-sign”,
“type”: “SIGNED_STATEMENT”
}

        ],
       "subject": {
            "id": "subject-id",
            "attributes": [
                {
                    "name": "national-id",
                    "value": "10109001290",  
                    "methods": [
                        "nemid-sign"
                    ]
                }     
            ]
        },
        "onTaskComplete": "https://en.wikipedia.org/wiki/Completeness",
        "onTaskReject": "https://en.wikipedia.org/wiki/Cancel",
        "notifications": [
            {
                "id": "callback-notification",
                "recipient": "https://en.wikipedia.org/wiki/Cancel",
                "schedule": [
                    {
                        "triggerStatus": "COMPLETED"
                    }
                ],
                "type": "URL"
            }
        ]
    }
],
"daysUntilDeletion" : 14,
"packagingTasks": [
    {
        "id": "packaging-task-id",
        "sendToArchive": true,
        "method": "pades",
        "documents": [
            {
                "taskId": "task-id",
                "documentIds": [
                    "doc-id"
                ]
            }
        ]
    }
]

}

This post has been migrated from the previous community