Update Package from Draft to Sent Postman
Friday, March 5, 2021 at 05:34amHey guys,
I'm trying to put together the following flow:
- Create a Package through Postman using the following payload.
- Add a document through a azure function (Its working).
- Update Package from Draft to Sent by making a Put request with only { "status": "SENT" }.
The last step always returns
{
"messageKey": "error.validation.sendPackage.noApprovals",
"message": "Cannot send package without approvals.",
"code": 400,
"name": "Validation Error"
}
For example Updating the package name works perfectly fine.
Updating signers returns code 200 but It doesn't update their emails.
I would like to know what is missing from my main payload in step 1 or what can I add in step 3 to be able to change from Draft to Sent. Also how can I make a put request that changes a signers characteristics ?
Reply to: Update Package from Draft to Sent Postman
Friday, March 5, 2021 at 10:29amHi Goncalo,
As per the error message "Cannot send package without approvals", it seems you didn't add any signature(approval) to the package, neither in step 1 or 2.
The link points to your payload seems to be broken, would you mind sharing it to [email protected] so that I can take a closer look at it? Also, not sure how you uploaded the documents through the azure function in step2, could you elaborate it a little bit more?
And in order to update signer email (or any other signer level attributes), you'd ping a more fine-grained API endpoint. (PUT /api/packages/{package_id} call will ONLY update package level attributes, like package timezone, language, settings, name, description, etc)
Duo
Reply to: Update Package from Draft to Sent Postman
Monday, March 8, 2021 at 08:43amHi Duo,
Payload corrected link -> https://pastebin.com/BFgtJZ9M
Ok so, my objective is to create a custom connector for Microsoft Flow so I can integrate your OneSpan Sign with Document Libraries in Sharepoint Online.
My first obstacle was sending a form-data request which custom connectors on Microsoft Flow don't allow. (By the way is it possible to send a document through application/json and if yes how is the format?)
So my solution was to divide the flow:
I believe that after reading your response I'm missing a step here where I need to add approvals? Like It shows here https://community.onespan.com/products/onespan-sign/sandbox#/Approvals/api.packages._packageId.documents._documentId.approvals.post ? For every document uploaded an approval must be added ?
Reply to: Hi Duo, Payload corrected…
Monday, March 8, 2021 at 09:03amHi Goncalo,
For invoking multipart/form-data request in Microsoft Flow, not sure if this post helps where it suggests to use a special JSON syntax:
https://powerusers.microsoft.com/t5/Connecting-To-Data/Send-multi-part-form-data-with-flow-HTTP-task/m-p/412066#M7102
For the questions:
# Is it possible to send a document through application/json and if yes how is the format?
I'm afraid the answer is No. No matter you are uploading document binary in package creation call, or later through a document upload call, the request type has to be multipart/form-data (if you are creating a package with request type of application/json, OneSpan Sign system won't expect the call to include "documents")
So if you can share a package ID with me, I can help you check if the document was successfully uploaded (which I am a bit worried about).
# missing a step here where I need to add approvals for every document uploaded
If a document doesn't contain any approval, then this document will be review only. But you can't have all documents review-only and there should be at least one document containing signature(s).
Duo
Reply to: Update Package from Draft to Sent Postman
Tuesday, March 9, 2021 at 10:42amHey Duo,
Yeah I was almost sure that It wouldn't be possible to do it by JSON. It's okay tho, I can add a document to a specific package through the .NET function. I'll be adding the approval step before submitting the documents for signing.
Thank you for your help!