-
-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Question] How to use webhooks with this app? #159
Comments
Hi, good to know that you liked the app's proposal. Did you complete the setup and successfully configure in https://libresign.github.io/libresign/Getting-started.html#webhook The first step after the configuration is OK will be to make a request to the LibreSign API requesting a document signature. The response from this endpoint is the UUID generated for the file to be signed. https://libresign.github.io/libresign/Getting-started.html#webhook-register For each person registered to sign a document, LibreSign checks whether it is a Nextcloud user, if it sends an email asking you to sign. If not, send the same email but the person will first see a screen for creating a user with the same email that was invited to sign the document. It is recommended that at the moment they are new users and not existing users in Nextcloud as we have not yet implemented a flow for creating the password to sign the document for those who do not have a signature password. After everyone signs, a POST is sent to a callback URL that is informed in the first request to register a new document to be signed. 2 fields are sent: uuid of the signed file and a file field with the signed file. This request is multipart. |
Thank you for your reply @vitormattos, now the whole process makes more sense to me :)
Yes, the email server settings are working correctly
Most probably I am not sending the correct header or body in the request. I am currently doing this: curl -X POST \
http://localhost/index.php/apps/libresign/api/0.1/webhook/register \
-H 'Accept: application/json' \
-H 'Authorization: Basic YWRtaW46YWRtaW4='\
-H 'Content-Type: application/json'
-d '{
"file": {
"url": "[link to pdf]"
},
"users": [
{
"display_name": "[name]",
"email": "[email]",
"description": "Lorem ipsum"
}
]
}' And getting this response
I have a couple of questions:
How can I set this callback URL? |
You need to generate your own base64 for the authorization header. It is recommended to use app-password of any account of your Nextcloud. The account used must either be in the admin group or in a group defined in
You need to implement in the application that will integrate with LibreSign a page that receives this request and does what it needs. The URL of this page is the callback url that you must send in all document signing requests for LibreSign As an example, there is the GLPI plugin that allows you to sign GLPI tickets on LibreSign. |
You mean "The account used must either be in the admin group or in a group defined in Settings> Security WEBHOOK" right? Could you implement a button "Request signature fo mail/username field" for this file in the "Signature Detail box"? This would be a very good example to see the webhook and the procedure running. |
The account that I mentioned is the account to use the API and that you will use to put in the header of the HTTP request to authorize access to the API, it is not of the people who will sign the document. The list of people who will sign the document is the one in the body of the request for the LibreSign API. |
Hi @vitormattos , I tried to access the API endpoint with my Nextcloud user like this: Now I tried with this same approach using the Could you please give me any pointers? |
Hi Carlos, Did you send a body for this request? It is necessary to send a json in the body of this request as it is in the example of the documentation. https://libresign.github.io/libresign/Getting-started.html#headers |
Hi @vitormattos, Sorry for the noise, it seems it was a formatting mistake with the body, but now it is working. Now I received the email with the signature request, but when I open it and enter the subscription password, it returns This might be, because the user and signature file are not linked, but I don't know how to do it. Until now, the user simply creates the file from the Libresign form "Create new subscription" and saves this Is there a step I am missing? |
This is a bug already identified. LibreSign today only works for accounts of people who do not have a Nextcloud account. The signature password is created when the person creates the account through LibreSign. Test with an email that is not from an existing user on Nextcloud. |
Thank you for the clarification! I will be happy to test when you develop the other features which will make this plugin fully usable. But in any case, nice work so far, this app really has great potential! Also, would you be OK to add some of your explanations in this thread to the Thanks again for your time |
Very happy for your comments. I strongly believe in the potential of this application. I will be very happy with your PR. The documentation page (it is in the |
Instead of webhook, mail, link the easiest way to sign internally would be with a simple "notification" in nextcloud directly, right? So to say: a little dropdownbox populated with the users to select one/some and a "request signature" button internally. Since every user can have the activity stream by mail, it would work quite fine using nextcloud directly. Maybe this approach would be the faster fix? In the meantime, all people facing this can use the following:
|
It's in the planning :-) We are not advancing so fast in development because we do not have funding at the moment for the app. |
We believe that the project documentation is already much better than before and we are closing this issue. |
Hi
First of all, thanks for the efforts to create this app, it is extremely useful. I am currently in the process of setting it up to test it. I have been able to configure the
cfssl
server, and now it is possible for the users to create signatures and there is a signature tab when I open the pdf sidebar.Unfortunately, I have not been able to request file signatures using webhooks. Should I write my own webhooks and made them available at this address?
https://nextcloud.local/index.php/apps/libresign/api/v1.0
I have been trying to follow a similar example of a POST request in the documentation with no luck.
Would it be possible to provide me a minimal example or a pointer for me to move forward?
PS: I am sorry if this is an obvious question, I am a complete noob with Nextcloud.
Thank you!
The text was updated successfully, but these errors were encountered: