This topic contains 1 reply, has 2 voices, and was last updated by  Duo_Liang 3 months, 1 week ago.

  • Author
    Posts
  • Participant
    nehme
    Advanced Member
    Member since: 23.07.2018
    Number of posts: 123

    Hello,

    How I can capture the decline reason, if the user decline to sign the package.

    Thanks,
    Nehme

    Keymaster
    Duo_Liang
    Guru
    Member since: 14.06.2018
    Number of posts: 691

    Score

    0

    Hi nehme,

    You can refer to this guide to retrieve decline reason.

    It’s stored at the “content” within “messages” attribute at package level:

    DocumentPackage documentPackage = client.GetPackage(packageId);
    IList messages = client.GetPackage(packageId).Messages;
    Debug.WriteLine(documentPackage.Status.ToString() + " reason : " + messages[0].Content);

    And this is the construction of the messages JSON:

    "messages": [
        {
          "status": "NEW",
          "from": {
            "group": null,
            "language": "en",
            "signature": null,
            "id": "a8e907ec-9472-4cb9-812a-efe5af88ed1b",
            "data": null,
            "title": "",
            "auth": {
              "scheme": "NONE",
              "challenges": []
            },
            "updated": "2018-05-02T15:56:02Z",
            "external": null,
            "knowledgeBasedAuthentication": null,
            "email": "mai33@mailinator.com",
            "firstName": "john",
            "lastName": "smith",
            "phone": "",
            "professionalIdentityFields": [],
            "userCustomFields": [],
            "company": "",
            "delivery": {
              "download": false,
              "email": false,
              "provider": false
            },
            "address": null,
            "created": "2018-05-02T15:56:03Z",
            "name": "",
            "specialTypes": []
          },
          "content": "I do not wish to sign electronically.",
          "created": "2018-05-04T19:13:22Z",
          "to": [],
          "documents": []
        }
      ]

    And you may want to make sure your package status is in DocumentPackageStatus.DECLINED

    Hope this could help!
    Duo


    Duo Liang
    OneSpan Junior Technical Evangelist
    • This reply was modified 3 months, 1 week ago by  Duo_Liang.
    • This reply was modified 3 months, 1 week ago by  Duo_Liang.

You must be logged in to reply to this topic.