luisalvarez20 | Posts: 20

Response /api/packages/{packageId}/documents not contain Approval element

0 votes

Hi, for business requerimient we are integrating Pega CRM application with OneSpan in order to achieve the Onboarding Digital project.

We are consume multiple API services in order to create Transaction in OneSpan.

1. Creates a package > POST ​/api​/packages
2. Adds a new document to an existing package. > POST /api/packages/{packageId}/documents
3. Retrieves a list of packages > GET /api/packages
4. Retrieves a specified document > GET /api/packages/{packageId}/documents/{documentId}
5. Updates an existing field related to an existing approval. > PUT ​/api​/packages​/{packageId}​/documents​/{documentId}​/approvals​/{approvalId}​/fields​/{fieldId}
6. Retrieves the url that a signer can use to sign a package. > GET {ResourceURL}/{PackageId}/roles/{RoleId}/signingUrl

Currently, we integrated directly Pega with OneSpan and obtain the URL.
However, by architecture design we need to use Api gateway before to consume OneSpan services. In this scenario we have an issue on the second service "POST /api/packages/{packageId}/documents". The response of the service not contain the Approvals element.

We don't know why when we consume onespan service by ApiGateway the response of the second service not have Approval element.

We are attaching "Differences in Response.xlsx" with more detail.

 


Duo_Liang | Posts: 3776

Reply to: Response /api/packages/{packageId}/documents not contain Approval element

0 votes

Hi Luis,

 

From the word file where you "connect directly to OneSpan Sign" vs "via API Gateway", I saw you were trying to upload the same document, with the same document ID "WordTemplateForm1", to the same package, . This could be a little bit tricky (because the latest upload replaces the existing document). Do you mind running another quick test by specifying two different document IDs before and after? And observe below aspects:

(1)I assumed that you are using text tags and want to confirm whether the fields are extracted from the response. So by connecting through API proxy, did the fields successfully extracted, regardless whether they are returned in "approval" node?

(2)I saw both the outbound request and the inbound response are converted to Pega objects. For example, "tagged" is converted to "OS_tagged", all null values and empty arrays are ignored which probably the case for "approval" node. Any possible you can get the raw response body? 

 

Duo


luisalvarez20 | Posts: 20

Reply to: Response /api/packages/{packageId}/documents not contain Approval element

0 votes

Hi Duo,

Thank you for your soon answer.

I did a mistake with the screenshot. As you said I am trying to upload the same document, with the same document ID "WordTemplateForm1" but in a different Package.

I am attaching the correct file: "Difference Response v2.docx" with the request/response respectively. Also, I am attaching "wordtemplateform1.docx" with have 2 tags as you mention on first point.

However, we are sending the same request but the response is different when we through by Api gateway.

Regards,

Luis

 


Duo_Liang | Posts: 3776

Reply to: Response /api/packages/{packageId}/documents not contain Approval element

0 votes

Hi Luis,

 

Thanks for the updates!

(1)If you logged onto web portal, and navigate to package "qpesdv-Y2G-uC1cahzMmFaWAUN8=" > document "WordTemplateForm1", are the fields successfully extracted?

(2)For your fourth tested API "Retrieves a specified document > GET /api/packages/qpesdv-Y2G-uC1cahzMmFaWAUN8=/documents/WordTemplateForm1", if you connect through API Gateway, are the "approvals" node get returned?

 

Duo


luisalvarez20 | Posts: 20

Reply to:

0 votes

Hi Duo,

About your questions:

1. Actually, when I am trying to search the packageID "qpesdv-Y2G-uC1cahzMmFaWAUN8=" I recieved "Error Cannot view Transaction" and then "Access Denied".

But If I searched packageID "Y-Crm5_WhhRxwZvat-jwq33ta0Y=" Yes we can see the fields were extracted successfully.

I am attaching word file with some screenshots.

2. The node "Approvals" is empty. 

I am thinking that maybe ApiGateway are using other credentials and pointing to other environment ... maybe for that reason we received "Access Denied". What do you think?

 


Duo_Liang | Posts: 3776

Reply to: Response /api/packages/{packageId}/documents not contain Approval element

0 votes

Hi Luis,

 

Your assumption is correct, these two packages are created by two different senders in different accounts. And for package "qpesdv-Y2G-uC1cahzMmFaWAUN8=", it failed to extract the text tags, that's why it's returning an empty "approvals" array.

 

Duo


luisalvarez20 | Posts: 20

Reply to:

0 votes

Hi Duo,

Thanks for your answer. 

Actually we changed the account on API GTW and now we can find the packageID on the Web Portal. However, when we open the document we saw that tags are not visible. 

We are attaching doc file with some screenshots.

Regards,

Luis

 


luisalvarez20 | Posts: 20

Reply to: Response /api/packages/{packageId}/documents not contain Approval element

0 votes

Hi Duo,

One more point, we tested directly by swagger web of OneSpan

https://community.onespan.com/products/onespan-sign/sandbox#/Documents/api.packages._packageId.documents.post

and also the service not convert the tags. We are attaching word with more details.

Regards,

Luis


Duo_Liang | Posts: 3776

Reply to: Response /api/packages/{packageId}/documents not contain Approval element

0 votes

Hi Luis,

 

Try using below JSON when you tested directly in swagger page:

 

{
      "id": "WordTemplateForm1-2",
      "name": "WordTemplateForm1",
      "extract": true,
      "extractionTypes":[
         "TEXT_TAGS"
      ]
    }

 

To set "extractionTypes" :[ "TEXT_TAGS" ] is a more standard way to enable text tags detection.

 

Duo


luisalvarez20 | Posts: 20

Reply to: Response /api/packages/{packageId}/documents not contain Approval element

0 votes

Hi Duo,

Thank you very much for you soon answer. 

I tested the json that you give me but it not retrieve approvals of document yet. This tested do from OneSpan swagger.

I am attaching doc with some screenshots. (Test Update Json.docx)

Luis


Duo_Liang | Posts: 3776

Reply to: Response /api/packages/{packageId}/documents not contain Approval element

0 votes

Hi Luis,

 

I see, for your package "xzv_m0mNwEA89YMgpSpGTWJWcwM=", in order to have the text tags detected(for example "{{esl:Signer1:Signature}}") , you need to add a signer with signer name of "Signer1" prior to the document uploading. If you:

(1)add a signer from sender UI, the first added signer will automatically be given signer name of "Signer1"

(2)try the above API again

You should be able to see the difference.

 

Duo


luisalvarez20 | Posts: 20

Reply to: Response /api/packages/{packageId}/documents not contain Approval element

0 votes

Hi Duo.

This is the request that we use in order to create Package from OneSpan swagger.

Could you tell me what value is missing? Before tu upload document and obtain approvals tags

CreatePackage

 


Duo_Liang | Posts: 3776

Reply to:

0 votes

The role name - "roles" array > "name" : "Signer1"

 "roles":[
         {
            "id":"09393301110",
            "name":"Signer1",
            "type":"SIGNER",

       .......

    }

]


luisalvarez20 | Posts: 20

Reply to: Response /api/packages/{packageId}/documents not contain Approval element

0 votes

Hi Duo,

Added a "name": "Signer1" to create PackageID. Then Upload Document but not receive approvals yet.

I am attaching word with the details "Test update signer.docx".

Do you think that could we have a call in order to solve this issue? If is possible let me know maybe by Teams or other media.

This integration is critical for the project.

Regards,

Luis


Duo_Liang | Posts: 3776

Reply to: Response /api/packages/{packageId}/documents not contain Approval element

0 votes

Hi Luis,

 

Sure, if you can share your availability this afternoon, we can set up a Zoom meeting. Also, per your JSON, instead of putting package JSON inside "payload", you should pass it directly:

{
   "roles":[
      {

         "id":"Signer1",
         "name":"Signer1",

         "signers":[
            {
               "email":"[email protected]",
               "firstName":"1.firstname",
               "lastName":"1.lastname",
               "company":"OneSpan Sign"
            }
         ]
      }
   ],
   "name":"Example Package",
   "type":"PACKAGE",
   "language":"en",
   "emailMessage":"",
   "description":"New Package",
   "autocomplete":true,
   "status":"SENT"
}

 

Duo


luisalvarez20 | Posts: 20

Reply to: Response /api/packages/{packageId}/documents not contain Approval element

0 votes

Hi Duo,

Thank you very much.

We are available for the next two hours, from now until 5:00pm (GMT-5).

Luis

 


luisalvarez20 | Posts: 20

Reply to: Response /api/packages/{packageId}/documents not contain Approval element

0 votes

Hi Duo,

Just to let you know that we could managed to integrate Pega with OneSpan through Api gateway.

Basically, as you told me on the zoom session the problem of the my request when we create Package is the property "Visibility". We remove that property and the others services worked correctly.

Now, one more question about other topic do you know how can we skip "Electronic Disclosures and Signatures Consent" document in order to the customer sign directly the contract.

Thanks a lot,

Luis


Duo_Liang | Posts: 3776

Reply to: Response /api/packages/{packageId}/documents not contain Approval element

0 votes

Great to hear that! Sure, you can contact support team ([email protected]) and remove the "Electronic Disclosures and Signatures Consent" entirely at account level. Or invoke API "DELETE /api/packages/{packageId}/documents/default-consent" to remove it for particular packages.

 

Duo


luisalvarez20 | Posts: 20

Reply to: Response /api/packages/{packageId}/documents not contain Approval element

0 votes

Hi Duo,

I am facing the same issue again related to approvals.

I am sending this request for create a new package. Then I invoke uploaddocuments API and not getting the approvals.

Do you know if I missing something in this request body.

 

Regards,

Luis


Duo_Liang | Posts: 3776

Reply to:

0 votes

Hi Luis,

 

From your payload, seems you are specifying the signer ID as "17391177127", are you specifying the same as text tags in PDF?

  "roles": [
    {
      "id": "17391177127",
      "name": "",
      "type": "SIGNER",
      "signers": [
        {
         ......
          "id": "17771391127",
          "name": ""
        }
      ],

......
    }
  ],

 

Duo


luisalvarez20 | Posts: 20

Reply to: Response /api/packages/{packageId}/documents not contain Approval element

0 votes

Hi Duo,

You are rigth! I correct that ID in order to same equals and now it works.

I don´t sure why works weeks ago but not it's work correctly with that correction.

Thank you very much.

Regards,

Luis


luisalvarez20 | Posts: 20

Reply to: Response /api/packages/{packageId}/documents not contain Approval element

0 votes

Hi Duo,

I am having the same issue but in other environment (QA environment). I reviewed the request and the ID are equals.

 

Regards,

Luis


Duo_Liang | Posts: 3776

Reply to:

0 votes

Hi Luis,

 

I assumed the QA environment meant the Pega environment, not OneSpan Sign environment. Then are both environments point to the same OneSpan Sign account / API Key?

 

Duo


luisalvarez20 | Posts: 20

Reply to: Response /api/packages/{packageId}/documents not contain Approval element

0 votes

Hi Duo,

Thank you for your soon answer.

Yes, we have two environemnts for Pega and Api Gateway, not for OneSpan. And as you say both environments point to the same Sign account / API Key.

Luis


Duo_Liang | Posts: 3776

Reply to:

0 votes

Without further investigating, I saw that the signer email is the same as the sender, do you have a chance to try using a different email? Or if the issue still consistent, we can arrange some time this afternoon for a quick session.

 

Duo


luisalvarez20 | Posts: 20

Reply to: Response /api/packages/{packageId}/documents not contain Approval element

0 votes

Hi Duo,

Oh you are right. Let me try and do some test cases.

Thks,

Luis


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