Hello!
I’m trying to add an attachment to a specific task but I’m getting this error:
{
“errors”: [
{
“message”: “file: File is not an object”,
“help”: “For more information on API status codes and how to handle them, read the docs on errors: Build an app with Asana”
}
]
}
I can’t tell for sure without seeing your whole request but it looks like you’re trying to pass just a filename. As @Bastien_Siebman says above, you need to pass the binary contents of the file.
You might find these forum posts helpful:
In terms of testing, I’m also not familiar with Insomenia but Asana provides a full collection of samples of their API calls for use in Postman here, including the “Upload an attachment” endpoint:
Hey, The problem I’m facing is only attaching a file using Postman/Insomnia for test purposes…
I’ve downloaded the Postman collection but I find that you don’t have this option to attach a file to a task built in… so I still need help over here.
I would very much appreciate it if you can let me know how can it be done…
I also attached 2 images that show that this step is existing on the Documentation but missing on the Postman collection.
When I set clicked on Upload an attachment the value was
I tried to search online Image to Binary convertor but all I tried still getting the same error.
I tried to encode an image to base64 and still the same error.
Please let me know if you find a solution.