Delete recipient with Rest API in Java - docusignapi

I am trying to delete a specific recipient from an envelope. I wrote a little Java program and tried various DELETE requests, but I always get an error back:
<errorCode>INVALID_REQUEST_BODY</errorCode>
<message>The request body is missing or improperly formatted. <signers xmlns=''> was not expected.</message>
I tried with this request:
baseURL + "/envelopes/" + envelopeId + "/recipients/"+recipientId;
and no body
as well as:
baseURL + "/envelopes/" + envelopeId + "/recipients/"
with body="<recipients xmlns:i=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns=\"http://www.docusign.com/restapi\"><agents><agent><recipientId>"+recipientId+"</recipientId></agent></agents></recipients>";
Both without success.

Have you tried referring to the DocuSign REST documentation regarding deleting recipients?
https://www.docusign.com.au/p/RESTAPIGuide/RESTAPIGuide.htm#REST API References/Delete Recipients from an Envelope.htm?Highlight=delete recipient

Related

How to share files in dropbox api using node.js

I want to share uploaded files in dropbox with another member.
add_member={
method: "POST",
url:'https://api.dropboxapi.com/2/sharing/add_file_member',
headers:{
"content-Type":"application/json",
"Authorization": "Bearer " + access_token,
"Data":"{\"file\": \"id:3kmLmQFnf1AAAAAAAAAAAw\",\"members\": [{\".tag\": \"email\",\"email\": \"jyotijagtap2209#gmail.com\"}],\"custom_message\": \"This is a custom message about ACME.doc\",\"quiet\": false,\"access_level\": \"viewer\",\"add_message_as_comment\": false}"
},
body:content
}
request(add_member,function(err,res,body){
console.log("link shared", body);
})
This is my code. I have also read documentation for Dropbox API but I can't get what is id given to this file and I didn't get any error. What I am missing?
The file parameter you supply to /2/sharing/add_file_member should be the id for the file for which you want to add a file member.
You can get the id for a file from the Metadata for the file, such as is returned by /2/files/get_metadata or /2/files/list_folder[/continue], for instance.
Also, note that /2/sharing/add_file_member uses the RPC request/response style, so your parameters should be sent as JSON in the request body, not a header.
In any case, make sure you check the resulting response status code and body to see if the call succeeded or failed, and to retrieve any returned result or error information.

DocuSign Get Envelope Status

I am calling https://demo.docusign.net/restapi/v2/accounts/{accountId}/envelopes/status?envelope_ids="{\"envelopeIds\":[\"903780a3-cfc4-4dd8-a7b0-90b10d783dc9\",\"8a579670-03ec-411c-b781-1091df7590ad\"]}" with HTTP PUT in c# with httpwebrequest but getting 400 bad request, please help to fix this one issue.
There are two ways to get status of multiple envelopes:
Using GET Call,
GET
/restapi/v2/accounts/{accountId}/envelopes/status?envelope_ids=39eddd06-0288-4288-91a1-dbe79c732524,
5b54c5dd-4c51-4bc1-8251-6e448de34fd4,8f77680d-90fa-4508-9353-0e0707b9518f
no curly braces in the GET call, just comma separated envelopeIds
Using PUT Call,
PUT /restapi/v2/accounts/{accountId}/envelopes/status?envelope_ids=request_body
Body should be -
{
"envelopeIds":["39eddd06-0288-4288-91a1-dbe79c732524",
"5b54c5dd-4c51-4bc1-8251-6e448de34fd4","8f77680d-90fa-4508-9353- 0e0707b9518f"]
}
PUT call is preferred, because using GET there is a limitation on the number of envelopeIds sent in the URL and you might get an error if you hit that limit, whereas in PUT call all envelopeIds are going in the payload so you will not see any error.

Generate gmail-attachment url to view

I'm working on project which can access all the pictures in g-mail.I've tried the G-mail API using node which can fetch all required attachments.But that requires to download the whole image.I can access the attachment id and message id using the API.Is there any way to generate the url of attachment (to view) so that i can provide a link to the required image from my project.
I actually found this related issue, Issue #134, and you may want to try the suggested solution.
You may fetch email attachments using this:
https://mail.google.com/mail/u/0/?ui=2&ik={ik_value}&view=att&th={message_id}&attid=0.{atachment_index}&disp=safe&zw
wherein, attachmment_index is just the index of the attachment. If there are 3 attachments and you want to get the 3rd file, the index value will be 3. This URL is a 302 header that acts like a link shortener for the download file. Opening this link will lead you to the attachment data
var ik = gmail.tracker.ik;
var id = gmail.get.email_id();
var aid = "1"; // gets the first attachment
var url = "https://mail.google.com/mail/u/0/?ui=2&ik=" + ik + "&view=att&th=" + id + "&attid=0." + aid + "&disp=safe&zw";
console.log(url);

Sign MimeBodyPart which has attachments in it (with Bouncycastle)

I am working with OpenAS2Server-1.3.3 library.
There sending a single document is working fine..
Now I wanted to modify it to send document with attachments, like we do with emails. In this scenario, all the decription work well, but signature verification failed (MIC is not matched)
This is how I am tring to send attachments with main doc:
Create a MimeMultipart and add two MimeBodyPart into it. (main document and the attachment)
Finally wrap the MimeMultipart within a MimeBodyPart (I am not sure this is the way to do this, but anyway Bouncycastle do not have API to sign MimeMultipart )
Could anyone tell me the correct way to sign a message with attachment ?
MimeBodyPart mainBody = new MimeBodyPart();
mainBody.setDataHandler(new DataHandler(byteSource));
MimeBodyPart attachemt1 = new MimeBodyPart();
attachemt1.attachFile("/home/user/Desktop/Test1.txt");
Multipart multipart = new MimeMultipart();
multipart.addBodyPart(mainBody);
multipart.addBodyPart(attachemt1);
MimeBodyPart body = new MimeBodyPart();
body.setContent(multipart);
body.setHeader("Content-Type", multipart.getContentType());
logger.info("--------------Attaching the file... Done");
I was able to get the issue and solution. I am just putting it here for anyone else who will try to do this kind of work.
I just dump the data that use for calculating MIC, at both sending side and receiving side. So the attached image will show the problem clearly.
So I added those header fields manually for all the attachments and main doc, at the sending side, as bellow.
mainBody.setHeader("Content-Type", "application/EDI-X12");
mainBody.setHeader("Content-Transfer-Encoding", "7bit");
Now it solved and "MIC is matched".

gmail url variables

I've set up my mailto links so that they open Gmail.
// you can code a url like this to push things into gmail
https://mail.google.com/mail/?view=cm&fs=1&tf=1&to=user#example.com
I understand there are several other variables:
&su= // email subject
&body= // body text
&disablechatbrowsercheck=1 // pretty self explanatory
The thing is I can't find a list anywhere with the possible ones.
Has anyone composed such a thing or found such a list.
Edit: You can now resort to classic mailto links to pass subject and body params:
email here
why bother doing that ? the mailto link will open the default mail client you have installed
i think having gmail notifier installed is enough
and that will be better to users with no gmail.
see here Making Gmail your default mail application or this Make mailto: links open in gmail
if not i found this example from here:
https://mail.google.com/mail?view=cm&tf=0" +
(emailTo ? ("&to=" + emailTo) : "") +
(emailCC ? ("&cc=" + emailCC) : "") +
(emailSubject ? ("&su=" + emailSubject) : "") +
(emailBody ? ("&body=" + emailBody) : "");
The example URLs for standard gmail, above, return a google error.
The February 2014 post to thread 2583928 recommends replacing view=cm&fs=1&tf=1 with &v=b&cs=wh.

Resources