Unable to Attach File to Row

Abhijit
Abhijit
edited 04/21/21 in API & Developers
curl https://api.smartsheet.com/2.0/sheets/{sheetId}/rows/{rowId}/attachments \
-H "Authorization: Bearer xxxx" \
-H "Content-Type: application/msword" \
-H 'Content-Disposition: attachment; filename="ProgressReport.docx"' \
-H "Content-Length: FILE_SIZE" \
-X POST \
--data-binary @ProgressReport.docx

Using Above API to attach a file but getting below errors -

1.If I don't Provide --data-binary @ProgressReport.docx then Getting error - "errorCode": 1011,"message": "A required header was missing or invalid: Content-Length"

2.After providing above tag get TimeOut error.

This is happening always. Do we need to provide "--data-binary @ProgressReport.docx" or providing Path in fileName will suffice ?

--data-binary Shoul contain all content of binary file eg --data-binary @"<<binary content>> ?"

Answers