How to Delete attachment in Asana trough API - asana-api

I have started implementing Asana APIs in my project where I create tasks in a particular project through API and then I add attachments to particular ask using through API,
However, I struggle in the case where I need to replace the attachment with a new one, the asana documentation for attachment does not provide a description for any API that can delete/replace an attachment directly neither the edit task API has this option
So How do I replace(or at least delete so that I can upload a new one), What is the best alternative way?

To delete an attachment, you can use the method DELETE with the same url as "Get an attachment". For modifying it, maybe it is possible to do it with PUT or PATCH, but I didn't test it.

I got the answer from Asana Community forum by Frederic_Malenfant stating that
It looks like the “new documentation” is missing that information!
But, the old one has, and you should send a “DELETE” to the attachment
ID, like: DELETE /api/1.1/attachments/123456789 You don’t need to
specify the task, just the document ID.
and I tried the DELETE API and it works
DELETE https://app.asana.com/api/1.1/attachments/:attachment_id
Somehow, the updated documentation is the missing description for the Delete attachment API despite the existence of the API.
Nevertheless,
The response for this delete API is quite weird, it replies empty object with key "data" in response as below
{
"data": {}
}

Related

DocuSign Template Prefil Fields Through API

I was a user of Right Signature, where we can create merge fields, and we can send the data through post request,
I have recently migrated to Docusign,
I see that they have prefil fields.
What I want to achieve is, Create Prefil fields, like Owner Name, Owner Email, etc,
And supply this fields through DOCUSIGN API, and send them. Is this functionality even possible.
I could not find any documentation, or perhaps I do not have the right search. Can some one point me to it, what will be the syntax for sending the templates, with prefil fields.
Thanks.
Anything you can do from the web app - you can do from API.
The term "pre-fill fields" means something very specific, but I'm not sure exactly what you want.
Any field in DocuSign can be "pre-filled" such that the value is set by the sender. The field can be read-only or can be edited by the person that it is assigned to.
You can also use pre-fill fields that are specific for the sender and therefore cannot be modified by anyone except the sender.
All of this is possible with the API, I suggest you first try it with the web app to understand. You can do everything for free with a developer account - try it and see if it serves your need.

Add document to envelope based on tempalte

I'm not very familiar with DocuSign or its API and after playing around in Postman I'm still not sure if I'm able to:
Create an Envelope based on a Template
Attach a pdf doc to said Envelope
Send for signing.
In case I got it all wrong, I'm trying to do the following:
Get the pdf doc from a third party and send it for signing via DocuSign. The document will be the same format every time(same signature placement, names, etc) except for data in it and it will be sent to the same people for signatures.
Is it possible to do so? Am I looking at right stuff?
Yes, this is completely possible. We in fact have existing Postman requests that do just that:
https://www.postman.com/docusign/workspace/docusign-s-public-workspace/request/14257714-ef2d10ba-b540-4644-93a1-b0344c0dd82c
Examples number 15 to 18 are the ones you want to look at.
To get started with our Postman collection, you can watch our youtube video: https://www.youtube.com/watch?v=mV73U2tg9c0&t=6s

Attach File that was returned in POST call

I have a Podio native webhook that posts to a service we created. That service then returns a PDF. Initially it was attaching the PDF as a file, but it is no longer doing that.
What does the incoming call need to look like to attach that PDF to the Podio item that sent the webhook?
Hope you've used the technique mentioned here - https://developers.podio.com/examples/files ?
The operation would first involve uploading the file and then attaching to an item. Two separate API calls would be required to do so. Later, could you please share the specific error you are facing? Snippets will help too.

Delete document from document service (SCP)

I've used this tutorial to create a document service API and the documents are uploading just fine. I'm trying to delete a document now, but there doesn't seem to be much information on that subject.
Can I delete a document with a Delete request and the document ID or what is the best practice?
Yes, you should delete request by passing the document id.
If you are using java CMIS client library, then Session#delete methods should be used.
Best Regards,
Saurav

Modifying a draft without downloading attachments

I have a draft saved on my Gmail account, containing an attachment. At a later stage, I realise that I have to add some text to the mail, via the Gmail API. At an even later stage, I decide to send the draft. From what I've found, the only way to do this is to:
Download the draft and decode it.
Edit the message body to your liking.
Encode it and save the draft.
Send the draft.
This is all well and good, until you have a big attachment in your draft. Is there another way than doing the steps outlined above with the Users.draft: update, so that you don't have to download the attachments when you just want to alter the message?
Thanks.
No, unfortunately there doesn't appear to be a simpler alternative at the moment. I'm not sure what API changes would be needed to support that use case, but you can file a feature request and we can talk to the team about it.

Resources