Help

Upcoming database upgrades. Airtable functionality will be reduced for ~15 minutes at 06:00 UTC on Feb. 4 / 10:00 pm PT on Feb. 3. Learn more here

Attachment upload via API results in error ""INVALID_ATTACHMENT_OBJECT""

Topic Labels: API
Solved
Jump to Solution
2166 3
cancel
Showing results for 
Search instead for 
Did you mean: 

I’m trying to update an existing record by adding an attachment with a url that points to a remote jpg file. I’m getting the error “INVALID_ATTACHMENT_OBJECT”, which is not very helpful.

curl -v -X PATCH https://api.airtable.com/v0/applxOrnAao5mXXXfek/Table%201
-H “Authorization: Bearer xxx”
-H “Content-Type: application/json”
–data ‘{
“records”: [
{
“id”: “recySiYkz0crwyS5P”,
“fields”: {
“Notes”: “testing 1”,
“Attachments”: [
{
“id”: “1”,
“size”: 26317,
“url”: “https://www.filepicker.io/api/file/5YTJXioCQG0tYWPw6OPw”,
“type”: “image/jpeg”
}
]
}
}
]
}’

I’m relatively new to the API so perhaps it’s something I’ve overlooked.

Thanks

1 Solution

Accepted Solutions

Dang I think that worked. I really appreciate that. So then will it get it’s own random id? and is not having size an issue?

See Solution in Thread

3 Replies 3

Hi David, and welcome to the community!

Um, just for yuks, try removing id, size, and type from the attachment data.

Dang I think that worked. I really appreciate that. So then will it get it’s own random id? and is not having size an issue?

Yes, it will generate an ID for the object and I think it computes the size by default. But since we removed three attributes we can’t really be sure which was giving you the error. You could spend the rest of the day hunting for the true cause, or kick back and enjoy the afternoon. :winking_face: