Print

ProfilZaufany_SendToSign()

ProfilZaufany_SendToSign() function sends selected document to Profil Zaufany (PZ) service and returns URL which allows to redirect user to Profil Zaufany’s website where signing process can be finalized.

Syntax

ProfilZaufany_SendToSign(userName,attachment);
ProfilZaufany_SendToSign(userName, attachment, options);

Function arguments

  • userName – (String) a user name (login) of the ePUAP user on behalf of whom document is sending (not signed yet) to PZ. ePUAP user may be linked to PZ user;
  • attachment – (File) a content of the message to be signed. It should be XML file.
  • options – (Object) [Optional] additional options to customize sending document to be signed. Available properties to set:
    • ’fieldName’ (defines a field where attachment after signing should be placed, default: replaces original attachment),
    • ’newVersion’ (only when original file is replaced, defines whether saved signed document as new version, dafault: false),
    • ’overrideAttachment’ (only when signed document is saved in different place than original, defines whether signed document can replace existing document, dafault: false).

Return value

This function returns Object.
ProfilZaufany_SendToSign() returns a JSON object with the following properties:

  • ’Status’ (only allowed values are 'OK’ and 'Error’),
  • ’Description’ (an error description),
  • ’Url’ (a URL that redirects to Profil Zaufany’s website where user can sign the sent document).

Examples

Example 1:
It will send the document from field 'DocumentWithMessage’ for signing in Profil Zaufany on behalf of user 'amoditoffice’. The current options determines that signed document will be placed in the field 'SignedDocument’. After successful call of the function, it will return URL that can be used along with other rule function RedirectToUrl(), which opens URL in a new tab and the user can finalize signing the document in Profil Zaufany’s website.

options.fieldName = "SignedDocument";
res = ProfilZaufany_SendToSign("amoditoffice", [DocumentToSign], options);
RedirectToUrl(JsonPath(res, "Url"),"new");
Czy artykuł był pomocny?
0 na 5 gwiazdek
5 Stars 0%
4 Stars 0%
3 Stars 0%
2 Stars 0%
1 Stars 0%
5
How can we improve this article?
How Can We Improve This Article?