I have created an envelope, added recipients and documents to the envelope through REST API call in apex code. Now I want to view my envelope in docusign user interface before ot it sent to the signers. Can I connect to the docusign from REST API call in apex and view the envelope?
There are different type of views you can use, based on the Envelope status, details are available at https://docs.docusign.com/esign/restapi/Envelopes/EnvelopeViews/ You might be interested in seeing https://docs.docusign.com/esign/restapi/Envelopes/EnvelopeViews/createCorrect/ or https://docs.docusign.com/esign/restapi/Envelopes/EnvelopeViews/createEdit/ or if sender wants to see it then https://docs.docusign.com/esign/restapi/Envelopes/EnvelopeViews/createSender/
You can use the EnvelopeViews: createSender API (also called Embedded Sending) to open the "tag and send" view of the envelope and let your users send it through the DocuSign Console. This also allows them to make changes to envelope before sending, given that they have the correct permissions.
This is what the API request typically looks like:
POST /v2/accounts/{accountId}/envelopes/{envelopeId}/views/sender
{
"returnUrl": "https://your.app.com/callback"
}
Once the user is done sending the envelope they will be redirected to the URL that's provided in the returnUrl parameter.
Related
I am trying to change account email in Keycloak, but did not find any useful information in the Keycloak official documentation.
I tried work with this endpoint
PUT /admin/realms/{realm}/users/{id}/execute-actions-email
but it only accepts an array of actions and sends to a user an email to perform specified actions.
But I want to update it directly performing my request. Is this possible?
I think you are looking for below API.
PUT /admin/realms/{realm}/users/{id}
with a JSON payload as below.
{
"email":"new#email.com"
}
When a user register to my web application I send an email to verify his inbox.
In the email there are a link to a resource like this:
GET /verify/{token}
Since the resource is being updated behind the scenes, doesn't it break the RESTful approach?
How can I do it in a RESTful manner?
What you are talking about is not REST. REST is for machine to machine communication and not for human to machine communication. You can develop a 1st party REST client, which sends the activation to the REST service.
You can use your verification URI in the browser to access the REST client:
# user follows a hyperlink in the browser manually
GET example.com/client/v1/verify/{token}
# asking the client to verify the token
and after that the REST client will get the hyperlink for verification from the REST service and send the POST to the service in the background.
# the REST client follows the hyperlinks given by the service automatically
# the REST client can run either on the HTTP client or server side
GET example.com/api/v1
# getting the starting page of the REST service
# getting the hyperlink for verification
POST example.com/api/v1/verification {token}
# following the verification hyperlink
If you have a server side 1st party REST client, then the HTTP requests to the REST service will run completely on the server and you won't see anything about it in the browser. If you have a client side REST client, then you can send the POST in the browser with AJAX CORS or you can try to POST directly with a HTML form (not recommended). Anyways the activation should be a POST or a PUT.
It depends on what are you trying to do.
Does it fire an email after validating the user for example? If so, it is not an idempotent method and you should use POST.
Example:
POST /users/{id}/verify/{token}
If the method doesn't have any consequence besides the update, I think you should use PUT.
Aren't you overthinking REST? With e-mail verification you want the user to be able to simply click the link from whatever mail user agent he is using, so you'll end up with a simple GET on the server (presented as a hyperlink to the user) with the token either in the path or as part of the query string:
GET http://example.com/verify-email/TOKEN
GET http://example.com/verify-email?token=TOKEN
Either is fine for this use case. It is not really a resource you are getting or creating; just a trigger for some process on the backend.
Why do you think this would run afoul of good design?
I'm having issue using DocuSign API. when I send a PDF via SOAP API. (I am using the method CreateEnvelopeFromTemplates, the templates are on your server) When the user received the envelope (PDF) the fields are not there. But when I send via the WEB they do have the fields.
I was not adding the Role to the API, now I'm but still not showing the fields.
Should I use the method CreateEnvelopeFromTemplatesAndForms instead the other one?
I believe you're using the right method (CreateEnvelopeFromTemplates). The most likely reason that the fields (tabs) are not being displayed when you create the Envelope via the API is that the recipient Role Name(s) being specified by the API request does not exactly match the Role Name(s) specified by the Template itself (with which the tabs are associated). Make sure spelling, spacing, and case of Role Name(s) specified by your API request matches exactly with what's specified by the Template.
I have created REST apis to manage a resource (with endpoint say /user/resource ). I can query the resource making a GET call and create the resource using the POST call. I use the api to manage resources from UI by making ajax calls to the REST api endpoint.
Now there is a requirement to send an email upon creating resource, and if the resource is already existing then sending a mail with the resource details in the mail (without modifying the resource) . I am confused if sending mail should be part of the the original REST api used for creating the resource or sending the mail should be handled separately . If "sending the mail" isn't part of the original REST api then it would involve some more handling on my UI for making another call to send a mail. Also if i expose "sending the mail" logic by means of another REST api then how should the endpoint be structured , will it be something like /user/resource/email since the mail sending is only related to the resource or should it be /user/email
Your question is not very clear. However, you can try to send mail in same api where you are performing business operation.
For example:
public Object createResource() {
//Perform your business operation here
//check if your resource is already exists or not. Depending on the result call
Object sendEail(..,..,..);
}
private Object sendEail(String address,String subject,String body) {
//Write code for sending mail here
}
I hope you understand my point.
I'm attempting to resend an envelope to recipients but get "This user lacks sufficient permissions to access this resource." The envelope was sent by our api user on behalf of another user which is also in the account. So the initial envelope creation would have looked like:
X-DocuSign-Authentication: <n:DocuSignCredentials xmlns:n="http://www.docusign.com/restapi"><IntegratorKey>MY-KEY</IntegratorKey><Password>password</Password><Username>api-user#here.there</Username><SendOnBehalfOf>other.user#somwhere.else</SendOnBehalfOf></n:DocuSignCredentials>
...
That succeeded and I can pull up the envelope audit events via the rest api. However, attempting to resend the envelope using the existing recipients as is as the same api-user results in:
<errorDetails>
<errorCode>USER_LACKS_PERMISSIONS</errorCode>
<message>This user lacks sufficient permissions to access this resource.</message>
</errorDetails>
Any ideas?
It turns out my error was in not specifying the same SendOnBehalfOf user when attempting the resend. Adding that in allows things to work as expected. Same for voiding an envelope and presumably any other envelope altering operation.