I am trying to use the Upload an Attachment API call to add a google drive attachment to a task. I tried testing the API call directly in the Asana API Reference page with the resource_subtype set to gdrive but I received the following error message: `[403] Cannot upload attachment with resource_subtype: gdrive’. Is this function just not supported yet or is this user error?
Here is the body of my API call
Here is what I have in the body:
{
"data": {
"parent": "1208645560847085",
"resource_subtype": "gdrive",
"name": "Test Brief Doc",
"url": "https://docs.google.com/spreadsheets/d/1sOckfv6ku-m0dadwoSh9w6wIJ9XJlMx9gYA3F7BKedE/edit?usp=drivesdk",
"host": "google"
}
}
@John_Baldo @John_Vu I tried a number of variations of parameters as well and was unable to get a GoogleDrive type attachment to upload via the API:
"error": "attachment_invalid_resource_subtype_on_creation",
"message": "Cannot upload attachment with resource_subtype: gdrive"
Could you check on this and see if it is possible to do via the API, and the proper parameters to use? Thanks very much!
1 Like
Thanks @Phil_Seeman for trying this out yourself.
I tried to reproduce this by:
- Attaching a GDrive attachment to a task in the Asana UI/web app
- Making a call to Get attachments from an object (GET /attachments) with the task gid for the parent query param → grabbed the attachment gid of the GDrive attachment
- Made a call to Get an attachment (GET /attachments/{attachment_gid}) endpoint to look up the GDrive attachment
- Used the info from the last step as reference to attach the GDrive attachment using Upload an attachment (POST /attachments) endpoint
- Ran into same error message as @Phil_Seeman
I asked around and it seems like this is not support via our API. I’ll see if I can find the team who owns this feature and ask for more details/put in feature request if it’s not supported.
1 Like
Hi John - thanks for the response. If there is a feature request for this, could you share it with me? It would be super helpful for some of my clients. Thanks!
Hi @Shaffaq_Noor, yes, I’ve already submitted a feature request for this.